Package com.badlogic.ashley.core

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


        engine.addSystem(system);
        engine.addEntity(e);

        //When entity has ComponentA
        e.add(new ComponentA());
        engine.update(deltaTime);

        assertEquals(0, system.numUpdates);

        //When entity has ComponentA and ComponentB
        system.numUpdates = 0;
View Full Code Here


        assertEquals(0, system.numUpdates);

        //When entity has ComponentA and ComponentB
        system.numUpdates = 0;
        e.add(new ComponentB());
        engine.update(deltaTime);

        assertEquals(1, system.numUpdates);

        //When entity has ComponentA, ComponentB and ComponentC
        system.numUpdates = 0;
View Full Code Here

        assertEquals(1, system.numUpdates);

        //When entity has ComponentA, ComponentB and ComponentC
        system.numUpdates = 0;
        e.add(new ComponentC());
        engine.update(deltaTime);

        assertEquals(1, system.numUpdates);

        //When entity has ComponentB and ComponentC
        system.numUpdates = 0;
View Full Code Here

        //When entity has ComponentB and ComponentC
        system.numUpdates = 0;
        e.remove(ComponentA.class);
        e.add(new ComponentC());
        engine.update(deltaTime);

        assertEquals(0, system.numUpdates);
    }
   
    @Test
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

          entity.add(new IntervalComponentSpy());
          engine.addEntity(entity);
        }

        for (int i = 1; i <= 10; ++i) {
          engine.update(deltaTime);
         
          for (int j = 0; j < entities.size(); ++j) {
              assertEquals(i / 2, im.get(entities.get(j)).numUpdates);
            }
        }
View Full Code Here

   
    engine.addSystem(new SystemA(10));
    engine.addSystem(new SystemB(5));
    engine.addSystem(new SystemA(2));
   
    engine.update(0);
  }
 
  public static class SystemA extends EntitySystem {
    public SystemA(int priority) {
      super(priority);
View Full Code Here

    engine.addSystem(system);
    engine.addEntity(e);
   
    //When entity has OrderComponent
    e.add(new OrderComponent("A", 0));
    engine.update(deltaTime);

    //When entity has OrderComponent and ComponentB
    e.add(new ComponentB());
    system.expectedNames.addLast("A");
    engine.update(deltaTime);
View Full Code Here

    engine.update(deltaTime);

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

    //When entity has OrderComponent, ComponentB and ComponentC
    e.add(new ComponentC());
    system.expectedNames.addLast("A");
    engine.update(deltaTime);
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.