Search in sources :

Example 16 with Position

use of ilargia.entitas.components.Position 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);
}
Also used : TestEntity(ilargia.entitas.utils.TestEntity) Group(ilargia.entitas.group.Group) TestEntity(ilargia.entitas.utils.TestEntity) Position(ilargia.entitas.components.Position) View(ilargia.entitas.components.View) ContextInfo(ilargia.entitas.api.ContextInfo) Before(org.junit.Before)

Example 17 with Position

use of ilargia.entitas.components.Position in project Entitas-Java by Rubentxu.

the class SystemsTest method addReactiveSystem2Test.

@Test
public void addReactiveSystem2Test() {
    TestReactive reactiveSystem = new TestReactive(context);
    Object contextsTest = new Object();
    systems.add(reactiveSystem);
    systems.deactivateReactiveSystems();
    context.createEntity().addComponent(TestComponentIds.Position, new Position(100, 100));
    systems.execute(1);
    context.createEntity().addComponent(TestComponentIds.Position, new Position(100, 100));
    systems.execute(1);
// assertTrue(reactiveSystem.flagExecute);
}
Also used : Position(ilargia.entitas.components.Position) Test(org.junit.Test)

Aggregations

Position (ilargia.entitas.components.Position)17 Test (org.junit.Test)15 TestEntity (ilargia.entitas.utils.TestEntity)6 IGroup (ilargia.entitas.api.IGroup)5 Group (ilargia.entitas.group.Group)5 IComponent (ilargia.entitas.api.IComponent)4 IEntity (ilargia.entitas.api.entitas.IEntity)3 ContextInfo (ilargia.entitas.api.ContextInfo)2 View (ilargia.entitas.components.View)2 PrimaryEntityIndex (ilargia.entitas.index.PrimaryEntityIndex)2 Before (org.junit.Before)2 EntitasCache (ilargia.entitas.caching.EntitasCache)1