com.artemis.WorldConfigurationBuilder Java Examples

The following examples show how to use com.artemis.WorldConfigurationBuilder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GameScreen.java    From libgdx-artemis-quickstart with MIT License 6 votes vote down vote up
protected World createWorld() {
    return new World(new WorldConfigurationBuilder()
            // keeps components available until all listeners have been called.
            // Use this if your systems need to access components to clean up after removal.
            .alwaysDelayComponentRemoval(true)
            // Describes dependencies on plugins. You can find more example plugins commented out in build.gradle.
            .dependsOn(
                    //EntityLinkManager.class,
                    //OperationsPlugin.class,
                    ProfilerPlugin.class,
                    FluidEntityPlugin.class)
            .with(
                    // put your own systems here! With the default InvocationStrategy they are called in order each frame.
                    new ExampleSystem()
            ).build());
}
 
Example #2
Source File: NetworkedGameScreen.java    From riiablo with Apache License 2.0 5 votes vote down vote up
@Override
protected WorldConfigurationBuilder getWorldConfigurationBuilder() {
  WorldConfigurationBuilder builder = super.getWorldConfigurationBuilder();
  builder.with(WorldConfigurationBuilder.Priority.HIGH, new ClientNetworkReceiver());
  builder.with(new ClientNetworkSyncronizer());
  builder.with(new Pinger());
  builder.with(new NetworkProfiler());
  return builder;
}
 
Example #3
Source File: OperationsPluginTest.java    From artemis-odb-orion with Apache License 2.0 5 votes vote down vote up
@Test
public void When_registering_operation_plugin_Should_register_operationsystem() {
    World world = new World(new WorldConfigurationBuilder()
            .dependsOn(OperationsPlugin.class)
            .build());
    Assert.assertNotNull(world.getSystem(OperationSystem.class));
    world.process();
}
 
Example #4
Source File: ProfilerPlugin.java    From riiablo with Apache License 2.0 4 votes vote down vote up
@Override
public void setup(WorldConfigurationBuilder b) {
  b.register(new ProfilerInvocationStrategy());
  b.dependsOn(WorldConfigurationBuilder.Priority.LOWEST + 1000, ProfilerManager.class, ProfilerSystem.class);
}
 
Example #5
Source File: GameScreen.java    From riiablo with Apache License 2.0 4 votes vote down vote up
protected WorldConfigurationBuilder getWorldConfigurationBuilder() {
    WorldConfigurationBuilder builder = new WorldConfigurationBuilder()
        .with(new NetworkIdManager())
        .with(new EventSystem())
        .with(new TagManager())
        .with(mapManager)
        .with(itemController, new ItemManager())
        .with(new CofManager())
        .with(new ObjectInitializer())
        .with(new ObjectInteractor(), new WarpInteractor(), new ItemInteractor())
        .with(new MenuManager(), new DialogManager())
        ;
    if (!DEBUG_TOUCHPAD && Gdx.app.getType() == Application.ApplicationType.Desktop) {
      builder.with(new CursorMovementSystem());
    }
    if (socket == null) {
      builder.with(new AIStepper());
    }
    builder
        .with(new Pathfinder())

        .with(new SoundEmitterHandler())

        .with(factory)
        .with(new AnimDataResolver())
        .with(new AnimStepper())
        .with(new CofUnloader(), new CofResolver(), new CofLoader())
        .with(new CofLayerUnloader(), new CofLayerLoader(), new CofLayerCacher())
        .with(new CofAlphaHandler(), new CofTransformHandler())
        .with(new ItemLoader())
        .with(new MissileLoader())
        .with(new AnimationStepper())
        .with(new ObjectCollisionUpdater())

        .with(new VelocityModeChanger());
//        .with(new VelocityAdder());
    if (socket != null) {
      // FIXME: crash when changing acts in multiplayer
      builder.with(new Box2DDisposer());
    }
    builder
        .with(new Box2DSynchronizerPre())
        .with(new Box2DPhysics(1 / 60f))
        .with(new Box2DSynchronizerPost())

        .with(new ZoneChangeTracker())
        .with(new ZoneMovementModesChanger())
        .with(new ZoneEntryDisplayer())

        .with(new SelectableManager())
        .with(new HoveredManager())
        .with(new WarpSubstManager())
        ;
    if (DEBUG_TOUCHPAD || Gdx.app.getType() == Application.ApplicationType.Android) {
      builder.with(new AutoInteracter());
    }
    builder
        .with(new PlayerItemHandler())

        .with(new SequenceHandler())

        .with(new AngularVelocity())
        .with(new DirectionResolver())

        .with(renderer)
        .with(new LabelManager())
        .with(new MonsterLabelManager())

        .with(new ItemEffectManager())

        .with(new PathDebugger())
        .with(new Box2DDebugger())
        .with(new PathfindDebugger())
        .with(new RenderSystemDebugger())

        .dependsOn(ProfilerPlugin.class)
        ;
    return builder;
  }
 
Example #6
Source File: OperationsPlugin.java    From artemis-odb-orion with Apache License 2.0 4 votes vote down vote up
@Override
public void setup(WorldConfigurationBuilder b) {
    b.dependsOn(WorldConfigurationBuilder.Priority.OPERATIONS, OperationSystem.class);
}