Package com.badlogic.ashley.core

Examples of com.badlogic.ashley.core.Engine.update()


    engine.update(deltaTime);

    //When entity has OrderComponent, ComponentB and ComponentC
    e.add(new ComponentC());
    system.expectedNames.addLast("A");
    engine.update(deltaTime);

    //When entity has ComponentB and ComponentC
    e.remove(OrderComponent.class);
    e.add(new ComponentC());
    engine.update(deltaTime);
View Full Code Here


    engine.update(deltaTime);

    //When entity has ComponentB and ComponentC
    e.remove(OrderComponent.class);
    e.add(new ComponentC());
    engine.update(deltaTime);
  }
 
  @Test
  public void entityRemovalWhileIterating(){
    Engine engine = new Engine();
View Full Code Here

      e.add(in);
     
      engine.addEntity(e);
    }
   
    engine.update(deltaTime);
   
    assertEquals(numEntities / 2, entities.size());
   
    for (int i = 0; i < entities.size(); ++i) {
      Entity e = entities.get(i);
View Full Code Here

      e.add(in);
     
      engine.addEntity(e);
    }
   
    engine.update(deltaTime);
   
    assertEquals(numEntities / 2, entities.size());
   
    for (int i = 0; i < entities.size(); ++i) {
      Entity e = entities.get(i);
View Full Code Here

    engine.addEntity(b);
    engine.addEntity(c);
    system.expectedNames.addLast("A");
    system.expectedNames.addLast("B");
    system.expectedNames.addLast("C");
    engine.update(0);
   
    engine.addEntity(d);
    system.expectedNames.addLast("A");
    system.expectedNames.addLast("B");
    system.expectedNames.addLast("D");
View Full Code Here

    engine.addEntity(d);
    system.expectedNames.addLast("A");
    system.expectedNames.addLast("B");
    system.expectedNames.addLast("D");
    system.expectedNames.addLast("C");
    engine.update(0);
   
    orderMapper.get(a).zLayer = 3;
    orderMapper.get(b).zLayer = 2;
    orderMapper.get(c).zLayer = 1;
    orderMapper.get(d).zLayer = 0;
View Full Code Here

    system.forceSort();
    system.expectedNames.addLast("D");
    system.expectedNames.addLast("C");
    system.expectedNames.addLast("B");
    system.expectedNames.addLast("A");
    engine.update(0);
  }
 
  private static class OrderComparator implements Comparator<Entity> {

    @Override
View Full Code Here

        IntervalSystemSpy intervalSystemSpy = new IntervalSystemSpy();
       
        engine.addSystem(intervalSystemSpy);

        for (int i = 1; i <= 10; ++i) {
          engine.update(deltaTime);
          assertEquals(i / 2, intervalSystemSpy.numUpdates);
        }
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.