Package com.artemis

Examples of com.artemis.World$AddedPerformer


 
  private World world;

  @Before
  public void setup() {
    world = new World();
    world.setSystem(new EntitySystemA());
    world.setSystem(new EntitySystemB());
    world.initialize();
   
    Entity e1 = world.createEntity();
View Full Code Here


public class EmptyPackedTest {
 
  @Test @SuppressWarnings("static-method")
  public void empty_packed_shouldnt_reference_bytbuffer() throws Exception {
    World world = new World();
    world.initialize();
   
    Entity e1 = world.createEntity();
    EmptyPacked empty = e1.createComponent(EmptyPacked.class);
    assertEquals(PackedComponent.class, empty.getClass().getSuperclass());
  }
View Full Code Here

 
  private World world;

  @Before
  public void setup() {
    world = new World();
    world.initialize();
  }
View Full Code Here

public class PooledAllFieldsTest {

  @Test @SuppressWarnings("static-method")
  public void pooled_class_transformation() throws Exception {
    World world = new World();
    world.initialize();
   
    Entity e = world.createEntity();
    PooledAllFields pooled = e.createComponent(PooledAllFields.class);
    assertEquals(PooledComponent.class, pooled.getClass().getSuperclass());
   
    Method reset = pooled.getClass().getMethod("reset");
    reset.setAccessible(true);
View Full Code Here

public class PackedWeaverGrowTest {
 
  @Test @SuppressWarnings("static-method")
  public void packed_weaver_components_grow_correctly() throws Exception {
    World world = new World();
    world.initialize();
   
    for (int i = 0; 2048 > i; i++)
      createEntity(world);
   
    Entity last = createEntity(world);
    last.createComponent(SimpleComponent.class).set(420);
   
    world.process();
   
    SimpleComponent component = last.getComponent(SimpleComponent.class);
    assertNotNull(component);
    assertEquals(420, component.get());
    assertCapacity(128 * 8, component);
View Full Code Here

public class PolyConstructorTest {
 
  @Test @SuppressWarnings("static-method")
  public void pooled_class_with_many_constructors() throws Exception {
    World world = new World();
    world.initialize();
   
    Entity e1 = world.createEntity();
    PolyConstructor pooled1 = e1.createComponent(PolyConstructor.class);
    assertEquals(PooledComponent.class, pooled1.getClass().getSuperclass());

    PolyConstructor pooled2 = new PolyConstructor(420);
    assertEquals(PooledComponent.class, pooled2.getClass().getSuperclass());
View Full Code Here

@SuppressWarnings("static-method")
public class ProfiledSystemsTest {
 
  @Test
  public void plain_profiled_system_invoked_during_process() {
    World world = new World();
    world.setSystem(new ProfiledSystem());
    world.initialize();
   
    Assert.assertNull(
        ProfiledSystem.class.getAnnotation(Profile.class));
   
    world.process();
    world.process();
   
    SimpleProfiler simpleProfiler = SimpleProfiler.lastInstance;
    Assert.assertNotNull(simpleProfiler);
   
    simpleProfiler.validate();
   
    Assert.assertEquals(2, simpleProfiler.startCount);
    Assert.assertEquals(2, simpleProfiler.stopCount);
   
    world.process();
    Assert.assertEquals(3, simpleProfiler.startCount);
    Assert.assertEquals(3, simpleProfiler.stopCount);
  }
View Full Code Here

    Assert.assertEquals(3, simpleProfiler.stopCount);
  }
 
  @Test
  public void multiple_exit_points_profiled_system() {
    World world = new World();
    world.setSystem(new ProfiledSystemB());
    world.initialize();
   
    Assert.assertNull(
        ProfiledSystemB.class.getAnnotation(Profile.class));
   
    world.process();
   
    SimpleProfiler simpleProfiler = SimpleProfiler.lastInstance;
    Assert.assertNotNull(simpleProfiler);
   
    simpleProfiler.validate();
   
    Assert.assertEquals(1, simpleProfiler.startCount);
    Assert.assertEquals(1, simpleProfiler.stopCount);
   
    world.process();
    Assert.assertEquals(2, simpleProfiler.startCount);
    Assert.assertEquals(2, simpleProfiler.stopCount);
  }
View Full Code Here

    Assert.assertEquals(EntitySystem.class, OptimizedSystemAdditional.class.getSuperclass());

    Method m = processMethod(OptimizedSystemAdditional.class);
    assertEquals(PRIVATE, m.getModifiers() & PRIVATE);

    World world = new World();
    world.setSystem(new OptimizedSystemAdditional());
    world.initialize();
  }
View Full Code Here

  private World world;

  @Before
  public void setup() {
    world = new World();
    world.initialize();
  }
View Full Code Here

TOP

Related Classes of com.artemis.World$AddedPerformer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.