use of ilargia.entitas.utils.TestEntity in project Entitas-Java by Rubentxu.
the class ContextTest method updateGroupsComponentAddedOrRemovedTest.
@Test
public void updateGroupsComponentAddedOrRemovedTest() {
Position position = new Position();
Group<TestEntity> group = context.getGroup(TestMatcher.Position());
group.OnEntityAdded((g, e, idx, pc) -> assertEquals(TestComponentIds.Position, idx));
entity.addComponent(TestComponentIds.Position, position);
context.updateGroupsComponentAddedOrRemoved(entity, TestComponentIds.Position, position, context._groupsForIndex);
context.updateGroupsComponentAddedOrRemoved(entity, TestComponentIds.Position, position, context._groupsForIndex);
//context.OnGroupCleared = (context, group)-> assertNull(context.OnEntityCreated);
}
use of ilargia.entitas.utils.TestEntity in project Entitas-Java by Rubentxu.
the class GroupTest method setUp.
@Before
public void setUp() throws Exception {
createCollections();
entity = new TestEntity();
entity.initialize(0, 10, new Stack[10], new ContextInfo("Test", TestComponentIds.componentNames(), TestComponentIds.componentTypes()), null);
entity.clearEventsListener();
entity.reactivate(0);
entity.addComponent(TestComponentIds.Position, new Position(100, 100));
entity.addComponent(TestComponentIds.View, new View(1));
group = new Group<TestEntity>(TestMatcher.Position(), TestEntity.class);
group2 = new Group(TestMatcher.Interactive(), Entity.class);
}
Aggregations