Search in sources :

Example 1 with ContextInfo

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

Example 2 with ContextInfo

use of ilargia.entitas.api.ContextInfo 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)

Aggregations

ContextInfo (ilargia.entitas.api.ContextInfo)2 Position (ilargia.entitas.components.Position)2 View (ilargia.entitas.components.View)2 TestEntity (ilargia.entitas.utils.TestEntity)2 Before (org.junit.Before)2 EntitasCache (ilargia.entitas.caching.EntitasCache)1 Group (ilargia.entitas.group.Group)1