Search in sources :

Example 1 with IGroup

use of ilargia.entitas.api.IGroup in project Entitas-Java by Rubentxu.

the class ContextTest method updateGroupsComponentReplacedTest.

@Test
public void updateGroupsComponentReplacedTest() {
    Position position = new Position();
    Position position2 = new Position();
    Group<TestEntity> groupE = context.getGroup(TestMatcher.Position());
    groupE.OnEntityUpdated((IGroup<TestEntity> group, final TestEntity entity, int index, IComponent previousComponent, IComponent nc) -> {
        System.out.println("Removed...........");
        assertEquals(position2, nc);
    });
    entity.addComponent(TestComponentIds.Position, position);
    context.updateGroupsComponentReplaced(entity, TestComponentIds.Position, position, position2, context._groupsForIndex);
}
Also used : TestEntity(ilargia.entitas.utils.TestEntity) Position(ilargia.entitas.components.Position) IComponent(ilargia.entitas.api.IComponent) IGroup(ilargia.entitas.api.IGroup) Test(org.junit.Test)

Aggregations

IComponent (ilargia.entitas.api.IComponent)1 IGroup (ilargia.entitas.api.IGroup)1 Position (ilargia.entitas.components.Position)1 TestEntity (ilargia.entitas.utils.TestEntity)1 Test (org.junit.Test)1