Search in sources :

Example 1 with WorldConfigurationBuilder

use of com.artemis.WorldConfigurationBuilder in project nhglib by VoidZombie.

the class EngineStateNotInitialized method enter.

@Override
public void enter(NhgEntry nhgEntry) {
    Logger.log(this, "Engine is not initialized.");
    // Setup the ECS world.
    WorldConfigurationBuilder configurationBuilder = new WorldConfigurationBuilder();
    // Configure user entity systems
    nhgEntry.onConfigureEntitySystems(configurationBuilder);
    // Configure the most important systems last, especially GraphicsSystem which
    // should be the last because it renders all the changes happened in all other
    // systems.
    configurationBuilder.with(new PhysicsSystem()).with(new CameraSystem()).with(new LightingSystem(nhgEntry.nhg.threading)).with(new GraphicsSystem(nhgEntry.nhg.entities, nhgEntry.nhg.messaging));
    nhgEntry.nhg.entities.setEntityWorld(new World(configurationBuilder.build()));
    nhgEntry.engineStarted();
    nhgEntry.getFsm().changeState(EngineStates.INITIALIZED);
}
Also used : PhysicsSystem(io.github.voidzombie.nhglib.runtime.ecs.systems.impl.PhysicsSystem) GraphicsSystem(io.github.voidzombie.nhglib.runtime.ecs.systems.impl.GraphicsSystem) CameraSystem(io.github.voidzombie.nhglib.runtime.ecs.systems.impl.CameraSystem) WorldConfigurationBuilder(com.artemis.WorldConfigurationBuilder) World(com.artemis.World) LightingSystem(io.github.voidzombie.nhglib.runtime.ecs.systems.impl.LightingSystem)

Aggregations

World (com.artemis.World)1 WorldConfigurationBuilder (com.artemis.WorldConfigurationBuilder)1 CameraSystem (io.github.voidzombie.nhglib.runtime.ecs.systems.impl.CameraSystem)1 GraphicsSystem (io.github.voidzombie.nhglib.runtime.ecs.systems.impl.GraphicsSystem)1 LightingSystem (io.github.voidzombie.nhglib.runtime.ecs.systems.impl.LightingSystem)1 PhysicsSystem (io.github.voidzombie.nhglib.runtime.ecs.systems.impl.PhysicsSystem)1