本文整理汇总了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);
}
示例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);
}
示例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));
}
示例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));
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例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();
}
示例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());
}
示例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);
}
示例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
}
示例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);
}
示例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
}
示例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);
}