use of ilargia.entitas.api.IComponent 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.api.IComponent in project Entitas-Java by Rubentxu.
the class ContextTest method clearComponentPoolsTest.
@Test
public void clearComponentPoolsTest() {
Stack[] cpool = context.getComponentPools();
cpool[0] = new Stack<IComponent>();
cpool[0].push(new Position());
assertEquals(1, cpool[0].size());
context.clearComponentPools();
assertTrue(cpool[0].empty());
}
use of ilargia.entitas.api.IComponent in project Entitas-Java by Rubentxu.
the class ContextTest method clearComponentPoolTest.
@Test
public void clearComponentPoolTest() {
Stack[] cpool = context.getComponentPools();
cpool[0] = new Stack<IComponent>();
cpool[0].push(new Position());
assertEquals(1, cpool[0].size());
context.clearComponentPool(0);
assertTrue(cpool[0].empty());
}
Aggregations