当前位置: 首页>>代码示例>>Java>>正文


Java WorldConfiguration类代码示例

本文整理汇总了Java中com.artemis.WorldConfiguration的典型用法代码示例。如果您正苦于以下问题:Java WorldConfiguration类的具体用法?Java WorldConfiguration怎么用?Java WorldConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


WorldConfiguration类属于com.artemis包,在下文中一共展示了WorldConfiguration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: Dispatch_TwoListeningSystem_BothCalled

import com.artemis.WorldConfiguration; //导入依赖的package包/类
@Test
public void Dispatch_TwoListeningSystem_BothCalled() {
    WorldConfiguration config = new WorldConfiguration();
    final EventSystem eventManager = new EventSystem();
    config.setSystem(eventManager);
    ReceiveSystem s1 = new ReceiveSystem();
    config.setSystem(s1);
    ReceiveSystem2 s2 = new ReceiveSystem2();
    config.setSystem(s2);
    config.setSystem(new DispatchSystem());

    World w = new World(config);
    w.process();

    // no exception = success
    assertEquals(1, s1.count);
    assertEquals(1, s2.count);
}
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:19,代码来源:InterSystemEventTest.java

示例2: test_Dispatch_TwoListeningSystem_BothCalled

import com.artemis.WorldConfiguration; //导入依赖的package包/类
public void test_Dispatch_TwoListeningSystem_BothCalled() {

        final WorldConfiguration config = new WorldConfiguration();
        final EventSystem eventManager = new EventSystem();
        config.setSystem(eventManager);
        ReceiveTestSystem s1 = new ReceiveTestSystem();
        config.setSystem(s1);
        ReceiveTestSystem2 s2 = new ReceiveTestSystem2();
        config.setSystem(s2);
        config.setSystem(new DispatchTestSystem());

        World w = new World(config);
        w.process();
        // no exception = success
        assertEquals(1, s1.count);
        assertEquals(1, s2.count);
    }
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:18,代码来源:InterSystemEventGwtTest.java

示例3: DeferredSystem_EntityAdded_RegisteredWithPrincipal

import com.artemis.WorldConfiguration; //导入依赖的package包/类
@Test
public void DeferredSystem_EntityAdded_RegisteredWithPrincipal() {

	EntityProcessPrincipal principal = mock(EntityProcessPrincipal.class);

	final WorldConfiguration config = new WorldConfiguration();
	config.setSystem(new TestDeferredSystem(Aspect.all(EmptyComponent.class), principal));
	// setup world and single entity.
	World w = new World(config);

	Entity myEntity = new EntityBuilder(w).with(EmptyComponent.class).build();
	w.process();

	// ensure it gets registered with the principal
	verify(principal, times(1)).registerAgent(eq(myEntity.getId()), any(EntityProcessAgent.class));
}
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:17,代码来源:DeferredEntityProcessingSystemTest.java

示例4: DeferredSystem_EntityRemoved_UnregisteredFromPrincipal

import com.artemis.WorldConfiguration; //导入依赖的package包/类
@Test
public void DeferredSystem_EntityRemoved_UnregisteredFromPrincipal() {

	EntityProcessPrincipal principal = mock(EntityProcessPrincipal.class);

	// setup world and single entity.
	WorldConfiguration config = new WorldConfiguration();
	config.setSystem(new TestDeferredSystem(Aspect.all(EmptyComponent.class), principal));
	World w = new World(config);
	Entity myEntity = new EntityBuilder(w).with(EmptyComponent.class).build();
	w.process();
	w.deleteEntity(myEntity);
	w.process();

	// ensure it gets registered with the principal
	verify(principal, times(1)).unregisterAgent(eq(myEntity.getId()), any(EntityProcessAgent.class));
}
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:18,代码来源:DeferredEntityProcessingSystemTest.java

示例5: init

import com.artemis.WorldConfiguration; //导入依赖的package包/类
public void init() {
    WorldConfiguration config = new WorldConfigurationBuilder()
            .with(new NetIdManager())
            .with(new CollisionSystem())
            .with(new ScriptSystem())
            .with(new NetworkEntitiesSystem())
            .build();
    mWorld = new World(config);
}
 
开发者ID:AlexMog,项目名称:SurvivalMMO,代码行数:10,代码来源:WorldManager.java

示例6: restart

import com.artemis.WorldConfiguration; //导入依赖的package包/类
public void restart() {
	
	setBatch(new SpriteBatch());
	
	loadLevel(getLevel());
	
	setMapRenderer(new OrthogonalTiledMapRenderer(map));
	
	//systems tick in order added by default
	WorldConfiguration worldConfig = new WorldConfiguration();
	worldConfig.setSystem(new WorldTimer(GameSettings.tickDelayGame));
	worldConfig.setSystem(new GameInput(GameSettings.tickDelayGame));
	//process world
	worldConfig.setSystem(new WorldSim(GameSettings.tickDelayGame));
	//process physics
	worldConfig.setSystem(new PhysicsWrapper(GameSettings.tickDelayGame));
	//process entities that respond to physics
	worldConfig.setSystem(new SpriteSim(GameSettings.tickDelayGame));
	worldConfig.setSystem(new MapRender());
	worldConfig.setSystem(new SpriteRender());
	worldConfig.setSystem(new SpriteRenderHUD());
	worldConfig.setSystem(new HUDRender());
	
	worldArtemis = new World(worldConfig);
	
	worldBox2D = new com.badlogic.gdx.physics.box2d.World(new Vector2(0, 0), true);

       loadLevelObjects();
	
	respawnPlayer();
}
 
开发者ID:Corosauce,项目名称:AI_TestBed_v3,代码行数:32,代码来源:Level.java

示例7: GameEngine

import com.artemis.WorldConfiguration; //导入依赖的package包/类
private GameEngine() {
	final InputMultiplexer inputMultiplexer = new InputMultiplexer();
	inputMultiplexer.addProcessor(UserIntefaceInputProcessor.getInstance());
	inputMultiplexer.addProcessor(InputSystem.getInstance());
	Gdx.input.setInputProcessor(inputMultiplexer);
	final WorldConfiguration config = new WorldConfiguration();
	Systems.setSystems(config);
	world = new World(config);
	ComponentMappers.mapComponents(world);
	Archetypes.createArchetypes(world);
}
 
开发者ID:davidbecker,项目名称:taloonerrl,代码行数:12,代码来源:GameEngine.java

示例8: setSystems

import com.artemis.WorldConfiguration; //导入依赖的package包/类
/**
 * adds the systems to the given {@link WorldConfiguration}
 *
 * @param config
 *            configuration to add systems to
 */
public static void setSystems(final WorldConfiguration config) {
	// order is important! systems are processed in given order
	config.setSystem(TURN_PROCESS_SYSTEM);
	config.setSystem(BLOCKING_TILE_CHECK_SYSTEM);
	config.setSystem(CONTROLLER_SYSTEM);
	config.setSystem(OFFSET_SYSTEM);
	config.setSystem(TURN_TAKEN_SYSTEM);
	config.setSystem(CAMERA_SYSTEM);
	config.setSystem(FOV_UPDATER_SYSTEM);
	config.setSystem(HIGHLIGHT_UPDATE_SYSTEM);
	config.setSystem(MAP_OVERLAY_PREPARER_SYSTEM);
}
 
开发者ID:davidbecker,项目名称:taloonerrl,代码行数:19,代码来源:Systems.java

示例9: Overworld

import com.artemis.WorldConfiguration; //导入依赖的package包/类
public Overworld() {
  assetManager = new AssetManager();

  camera = new HelixCamera(60, new Vector3(0, -30, 30), .01f, 300);

  WorldConfiguration worldConfiguration 
      = new WorldConfiguration().register(assetManager)
                                .register(camera);
  world = new World(worldConfiguration);

  world.setManager(new UuidEntityManager());
  world.setManager(new TextureManager());
  world.setManager(new TagManager());
  world.setManager(new GroupManager());
  world.setManager(new AreaManager());
  world.setManager(new WeatherMan());
  world.setManager(new LocalAmbienceManager());
  world.setManager(displayableIntermediary = new DisplayableIntermediary());
  world.setManager(cameraIntermediary = new CameraIntermediary());

  world.setSystem(new CameraControlSystem());
  world.setSystem(new TileHighlightingSystem());
  world.setSystem(new TilePermissionsEditingSystem());
  world.setSystem(new RenderingSystem());

  world.initialize();
}
 
开发者ID:fauu,项目名称:HelixEngine,代码行数:28,代码来源:Overworld.java

示例10: Overworld

import com.artemis.WorldConfiguration; //导入依赖的package包/类
public Overworld() {
  assetManager = new AssetManager();

  camera = new HelixCamera(30, new Vector3(16, 16, 0), .1f, 35);

  WorldConfiguration worldConfiguration 
      = new WorldConfiguration().register(assetManager)
                                .register(camera);

  world = new World(worldConfiguration);

  world.setSystem(new PlayerMovementSystem());
  world.setSystem(new CameraClientsUpdateSystem());
  world.setSystem(new AnimationProcessingSystem());
  world.setSystem(new RenderingSystem());
  world.setSystem(new ScreenFadingSystem());

  world.setManager(new UuidEntityManager());
  world.setManager(new TextureManager());
  world.setManager(new GroupManager());
  world.setManager(new TagManager());
  world.setManager(new AreaManager());
  world.setManager(new PlayerManager());
  world.setManager(new LocalAmbienceManager());
  world.setManager(new WeatherMan());
  world.initialize();

  world.getManager(WeatherMan.class)
       .setToType(WeatherMan.WeatherType.SUNNY);
  world.getManager(AreaManager.class).load("area1");
  // Temporary
  world.getManager(LocalAmbienceManager.class)
       .setAmbience(world.getManager(WeatherMan.class).getWeather());
}
 
开发者ID:fauu,项目名称:HelixEngine,代码行数:35,代码来源:Overworld.java

示例11: Dispatch_OneListeningSystem_SystemReceivesEvent

import com.artemis.WorldConfiguration; //导入依赖的package包/类
@Test
public void Dispatch_OneListeningSystem_SystemReceivesEvent() {
    WorldConfiguration config = new WorldConfiguration();
    final EventSystem eventManager = new EventSystem();
    config.setSystem(eventManager);
    ReceiveSystem s1 = new ReceiveSystem();
    config.setSystem(s1);
    config.setSystem(new DispatchSystem());
    World w = new World(config);
    w.process();
    assertEquals(1, s1.count);
}
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:13,代码来源:InterSystemEventTest.java

示例12: Dispatch_NoListeningSystem_NoExceptions

import com.artemis.WorldConfiguration; //导入依赖的package包/类
@Test
public void Dispatch_NoListeningSystem_NoExceptions() {
    WorldConfiguration config = new WorldConfiguration();
    final EventSystem eventManager = new EventSystem();
    config.setSystem(eventManager);
    config.setSystem(new DispatchSystem());
    World w = new World(config);
    w.process();
    // no exception = success
}
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:11,代码来源:InterSystemEventTest.java

示例13: test_Dispatch_OneListeningSystem_SystemReceivesEvent

import com.artemis.WorldConfiguration; //导入依赖的package包/类
public void test_Dispatch_OneListeningSystem_SystemReceivesEvent() {
    WorldConfiguration config = new WorldConfiguration();
    final EventSystem eventManager = new EventSystem();
    config.setSystem(eventManager);
    ReceiveTestSystem s1 = new ReceiveTestSystem();
    config.setSystem(s1);
    config.setSystem(new DispatchTestSystem());

    World w = new World(config);
    w.process();
    assertEquals(1, s1.count);
}
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:13,代码来源:InterSystemEventGwtTest.java

示例14: test_Dispatch_NoListeningSystem_NoExceptions

import com.artemis.WorldConfiguration; //导入依赖的package包/类
public void test_Dispatch_NoListeningSystem_NoExceptions() {
    final WorldConfiguration config = new WorldConfiguration();
    final EventSystem eventManager = new EventSystem();
    config.setSystem(eventManager);
    config.setSystem(new DispatchTestSystem());
    World w = new World(config);
    w.process();
    // no exception = success
}
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:10,代码来源:InterSystemEventGwtTest.java

示例15: test_runartemis_processsimplesystem_noexceptions

import com.artemis.WorldConfiguration; //导入依赖的package包/类
public void test_runartemis_processsimplesystem_noexceptions() throws Exception {
    WorldConfiguration config = new WorldConfiguration();
    config.setSystem(new TagManager());

    CountingTestSystem s = new CountingTestSystem();
    config.setSystem(s);

    World w = new World(config);
    w.process();

    assertEquals(1, s.count);
}
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:13,代码来源:BasicArtemisGwtTest.java


注:本文中的com.artemis.WorldConfiguration类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。