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


Java WorldConfiguration.setSystem方法代码示例

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


在下文中一共展示了WorldConfiguration.setSystem方法的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: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: setup

import com.artemis.WorldConfiguration; //导入方法依赖的package包/类
@Setup
public void setup()
{
	WorldConfiguration config = new WorldConfiguration();
	em = new EventSystem(instanceDispatcher(), new SubscribeAnnotationFinder());
	config.setSystem(em);
	activeEventHandlers = new ActiveEventHandlers();
	config.setSystem(activeEventHandlers);
	config.setSystem(new PaddingHandlers());

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

示例13: setup

import com.artemis.WorldConfiguration; //导入方法依赖的package包/类
@Setup
public void setup()
{
	final WorldConfiguration config = new WorldConfiguration();

	em = new EventSystem(instanceDispatcher(), new SubscribeAnnotationFinder());
	config.setSystem(em);
	activeEventHandlers = new ActiveEventHandlers();
	config.setSystem(activeEventHandlers);
	config.setSystem(new PaddingHandlers());

	World w = new World(config);
}
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:14,代码来源:ClassBasedDispatcherBenchmark.java

示例14: initializeDefaultServer

import com.artemis.WorldConfiguration; //导入方法依赖的package包/类
protected World initializeDefaultServer(MarshalDictionary marshalDictionary, boolean start) {

        final WorldConfiguration config = new WorldConfiguration();
        serverNetworkSystem = new MarshalSystem(marshalDictionary, new KryonetServerMarshalStrategy(TEST_HOST, TEST_PORT));
        config.setSystem(serverNetworkSystem);

        final World result = new World(config);
        if ( start ) serverNetworkSystem.start();
        return result;
    }
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:11,代码来源:NetworkIntegrationTest.java

示例15: initializeDefaultClient

import com.artemis.WorldConfiguration; //导入方法依赖的package包/类
protected World initializeDefaultClient(MarshalDictionary marshalDictionary, boolean start) {

        final WorldConfiguration config = new WorldConfiguration();
        clientNetworkSystem = new MarshalSystem(marshalDictionary, new KryonetClientMarshalStrategy(TEST_HOST, TEST_PORT));
        config.setSystem(clientNetworkSystem);

        World c = new World(config);
        if ( start ) clientNetworkSystem.start();

        return c;
    }
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:12,代码来源:NetworkIntegrationTest.java


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