Search in sources :

Example 1 with Console

use of org.terasology.logic.console.Console in project Terasology by MovingBlocks.

the class ComponentSystemManager method initialise.

public void initialise() {
    if (!initialised) {
        console = context.get(Console.class);
        for (ComponentSystem system : iterateAll()) {
            initialiseSystem(system);
        }
        initialised = true;
    } else {
        logger.error("ComponentSystemManager got initialized twice");
    }
}
Also used : Console(org.terasology.logic.console.Console) ComponentSystem(org.terasology.entitySystem.systems.ComponentSystem)

Example 2 with Console

use of org.terasology.logic.console.Console in project Terasology by MovingBlocks.

the class ComponentSystemManagerTest method setUp.

@Before
public void setUp() {
    Context context = mock(Context.class);
    EntityManager entityManager = mock(EntityManager.class);
    when(entityManager.getEventSystem()).thenReturn(mock(EventSystem.class));
    when(context.get(EntityManager.class)).thenReturn(entityManager);
    console = mock(Console.class);
    when(context.get(Console.class)).thenReturn(console);
    systemUnderTest = new ComponentSystemManager(context);
}
Also used : Context(org.terasology.context.Context) EntityManager(org.terasology.entitySystem.entity.EntityManager) Console(org.terasology.logic.console.Console) EventSystem(org.terasology.entitySystem.event.internal.EventSystem) Before(org.junit.Before)

Aggregations

Console (org.terasology.logic.console.Console)2 Before (org.junit.Before)1 Context (org.terasology.context.Context)1 EntityManager (org.terasology.entitySystem.entity.EntityManager)1 EventSystem (org.terasology.entitySystem.event.internal.EventSystem)1 ComponentSystem (org.terasology.entitySystem.systems.ComponentSystem)1