use of ilargia.entitas.components.Position in project Entitas-Java by Rubentxu.
the class SystemsTest method addReactiveSystemTest.
@Test
public void addReactiveSystemTest() {
TestReactive reactiveSystem = new TestReactive(context);
systems.add(reactiveSystem);
systems.activateReactiveSystems();
context.createEntity().addComponent(TestComponentIds.Position, new Position(100, 100));
systems.execute(1);
// assertTrue(reactiveSystem.flagExecute);
}
use of ilargia.entitas.components.Position in project Entitas-Java by Rubentxu.
the class EntityTest method notEnabled3.
@Test(expected = EntityIsNotEnabledException.class)
public void notEnabled3() {
entity.destroy();
entity.replaceComponent(TestComponentIds.Position, new Position(100, 100));
}
use of ilargia.entitas.components.Position in project Entitas-Java by Rubentxu.
the class EntityTest method OnComponentReplacedTest.
@Test
public void OnComponentReplacedTest() {
entity.OnComponentReplaced((IEntity e, int index, IComponent c, IComponent n) -> assertEquals(33F, ((Position) n).x, 0.1f));
entity.replaceComponent(TestComponentIds.Position, new Position(33, 100));
}
use of ilargia.entitas.components.Position in project Entitas-Java by Rubentxu.
the class EntityTest method notEnabled.
@Test(expected = EntityIsNotEnabledException.class)
public void notEnabled() {
entity.destroy();
entity.addComponent(TestComponentIds.Position, new Position(100, 100));
}
use of ilargia.entitas.components.Position in project Entitas-Java by Rubentxu.
the class EntityTest method setUp.
@Before
public void setUp() throws Exception {
createCollections();
_componentPools = new Stack[10];
EntitasCache cache = new EntitasCache();
entity = new TestEntity();
entity.initialize(0, 10, _componentPools, new ContextInfo("Test", TestComponentIds.componentNames(), TestComponentIds.componentTypes()));
entity.clearEventsListener();
entity.reactivate(0);
entity.addComponent(TestComponentIds.Position, new Position(100, 100));
entity.addComponent(TestComponentIds.View, new View(1));
}
Aggregations