本文整理汇总了Java中com.artemis.World.setManager方法的典型用法代码示例。如果您正苦于以下问题:Java World.setManager方法的具体用法?Java World.setManager怎么用?Java World.setManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.artemis.World
的用法示例。
在下文中一共展示了World.setManager方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createWorld
import com.artemis.World; //导入方法依赖的package包/类
private void createWorld() {
world = new World();
world.setManager(new GroupManager());
createPlayer();
world.setSystem(new PlayerRenderSys(game, camera));
world.setSystem(new SingleSpriteRenderSys(game, camera));
world.setSystem(new MovementSys());
world.setSystem(new InputSys(camera));
world.setSystem(new ShotSys());
world.setSystem(new EnemySpawnSys());
world.setSystem(new TargetSys());
world.setSystem(new CollisionSys(game));
world.setSystem(new TimeDelSys());
world.setSystem(new PathFollowSys());
world.setSystem(new CullingSys());
world.setSystem(new PlayerBoundSys());
world.setSystem(new MoveWithPlayerSys(player));
world.initialize();
}
示例2: Overworld
import com.artemis.World; //导入方法依赖的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();
}
示例3: Overworld
import com.artemis.World; //导入方法依赖的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());
}
示例4: launch
import com.artemis.World; //导入方法依赖的package包/类
/**
* Launches the server so it can handle the world and everything happening it it.
* <p> Also adds input for the server so you can input commands.
*/
public void launch() {
System.out.println("Loading world..");
world = new World();
EntityManager.setWorld(world);
world.setManager(new GroupManager());
world.setSystem(new EntityUpdaterSystem(this));
world.setSystem(new PlayerMovementSystem());
world.setSystem(new AccelerationSystem());
world.setSystem(new FrictionSystem());
world.setSystem(new MovementSystem());
world.initialize();
System.out.println("Server online.");
// Creating new thread for input
inputHandler = new ConsoleInputHandler();
inputThread = new Thread(inputHandler);
inputThread.setName("Console-Input-Thread");
inputThread.start();
// Creating new thread for world processing
worldProcessor = new ServerWorldProcessor(world);
worldProcessorThread = new Thread(worldProcessor);
worldProcessorThread.setName("World-Processor-Thread");
worldProcessorThread.start();
}
示例5: create
import com.artemis.World; //导入方法依赖的package包/类
@Override
public void create() {
if (DEBUG) {
Gdx.app.setLogLevel(Application.LOG_DEBUG);
Gdx.app.debug("DEBUG", "Debug logging enabled.");
} else {
Gdx.app.setLogLevel(Application.LOG_ERROR);
LevelEntityFactory.VERBOSE_LOAD = false;
}
world = new World();
batch = new SpriteBatch();
camera = new OrthographicCamera(Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2);
movementSystem = new MovementSystem(0.0f);
terrainCollisionSystem = new TerrainCollisionSystem(null);
linkingSystem = new LinkingSystem();
audioSystem = new AudioSystem();
world.setSystem(new PlayerInputSystem(this));
world.setSystem(new PlatformInputSystem(camera, terrainCollisionSystem));
world.setSystem(new SolidProcessingSystem(linkingSystem));
world.setSystem(terrainCollisionSystem);
world.setSystem(movementSystem);
world.setSystem(linkingSystem);
world.setSystem(new FocusTakerSystem(camera));
world.setSystem(new TiledRenderingSystem(batch, camera));
world.setSystem(new SpriteRenderingSystem(batch, camera));
world.setSystem(audioSystem);
if (DEBUG) {
terrainDebugSystem = new TerrainCollisionBoxRenderingDebugSystem(camera, terrainCollisionSystem);
world.setSystem(new CollisionBoxRenderingDebugSystem(camera));
world.setSystem(terrainDebugSystem);
}
world.setSystem(new LevelAdvanceSystem(this), true);
world.setManager(new GroupManager());
world.initialize();
playerEntityFactory = new PlayerEntityFactory(world);
playerEntity = playerEntityFactory.createEntity(5.0f, 5.0f, true);
levelEntityFactory = new LevelEntityFactory(world, batch);
nextLevel();
audioSystem.start();
}
示例6: OverworldScreen
import com.artemis.World; //导入方法依赖的package包/类
public OverworldScreen(ThingsThatWereGame game, SpriteBatch batch, World world, SessionSettings settings) {
super(game, world, batch);
cameraMovementSystem = world.setSystem(new CameraMovementSystem(camera));
stage = new Stage(new ScreenViewport(), new SpriteBatch());
map = new GameMap(settings.mapType.get().algo.getMapData(settings.map), settings.empires);
iconsSystem = world.setSystem(new IconsSystem(), true);
notificationsSystem = world.setSystem(new NotificationsSystem(), true);
eventsSystem = world.setSystem(new EventsSystem(), true);
effectsSystem = world.setSystem(new EffectsSystem(), true);
world.setSystem(new SpecialDiscoveriesSystem(this), true);
discoverySystem = world.setSystem(new DiscoverySystem(settings, map, this), true);
policiesSystem = world.setSystem(new PoliciesSystem(), true);
diplomaticSystem = world.setSystem(new DiplomaticSystem(this, settings.startWithDiplomacy.get()), true);
influenceSystem = world.setSystem(new InfluenceSystem(map), true);
revoltSystem = world.setSystem(new RevoltSystem(map, settings, this), true);
disasterSystem = world.setSystem(new DisasterSystem(this), true);
armiesSystem = world.setSystem(new ArmiesSystem(map, this), true);
destinationSystem = world.setSystem(new DestinationSystem(map, this), true);
scoreSystem = world.setSystem(new ScoreSystem(settings, this), true);
aiDestination = world.setSystem(new AISourceDestinationSystem(map, this), true);
aiDiscovery = world.setSystem(new AIDiscoverySystem(), true);
aiDiplomacy = world.setSystem(new AIDiplomaticSystem(map), true);
aiCommand = world.setSystem(new AIArmyCommandSystem(map, this), true);
aiArmies = world.setSystem(new AIArmyMovementSystem(map, this), true);
influenceRenderSystem = world.setSystem(new InfluenceRenderSystem(camera, batch, map), true);
diplomacyRenderSystem = world.setSystem(new DiplomacyRenderSystem(camera, batch), true);
textBoxRenderSystem = world.setSystem(new TextBoxRenderSystem(camera, batch), true);
destinationRenderSystem = world.setSystem(new DestinationRenderSystem(camera, batch), true);
spriteRenderSystem = world.setSystem(new SpriteRenderSystem(camera, batch), true);
counterRenderSystem = world.setSystem(new CounterRenderSystem(camera, batch), true);
fadingMessageRenderSystem = world.setSystem(new FadingMessageRenderSystem(camera, batch), true);
world.initialize();
empires = fillWorldWithEntities();
discoverySystem.process();
policiesSystem.process();
diplomaticSystem.process();
influenceSystem.process();
revoltSystem.process();
disasterSystem.process();
armiesSystem.process();
destinationSystem.process();
scoreSystem.process();
diplomacyRenderSystem.preprocess();
influenceRenderSystem.preprocess();
textBoxRenderSystem.preprocess();
iconsSystem.process();
notificationsSystem.process();
log.info("The world is initialized");
inputManager = new InputManager(camera, world, this, stage, map);
inputManager.menuBuilder.buildTurnMenu();
inputManager.menuBuilder.buildNotificationMenu();
inputManager.menuBuilder.buildEmpireMenu();
world.setManager(new PlayerManager());
mapRenderer = new MapRenderer(camera, batch, map);
mapHighlighter = new MapHighlighter(camera, batch);
renderHighlighter = false;
pauseScreen = new PauseMenuScreen(game, world, batch, this);
diplomacyScreen = new DiplomacyMenuScreen(game, world, batch, this, empires, player, diplomaticSystem);
discoveryScreen = new DiscoveryMenuScreen(game, world, batch, this, player, discoverySystem);
askDiscoveryScreen = new AskDiscoveryScreen(game, world, batch, this, player, discoverySystem);
askEventScreen = new AskEventScreen(game, world, batch, this);
policiesScreen = new PoliciesMenuScreen(game, world, batch, this, player, policiesSystem, effectsSystem,
revoltSystem);
scoresScreen = new ScoresMenuScreen(game, world, batch, this, scoreSystem);
armiesScreen = new ArmiesMenuScreen(game, world, batch, this, player, armiesSystem);
}
示例7: initWorld
import com.artemis.World; //导入方法依赖的package包/类
/**
* Initializes the world for Client.
*/
public void initWorld() {
world = new World();
EntityManager.setWorld(world);
world.setManager(new GroupManager());
world.setSystem(new FPSCounterSystem());
world.setSystem(renderingSystem = new RenderingSystem());
world.setSystem(new PlayerMovementSystem());
world.setSystem(new AccelerationSystem());
world.setSystem(new FrictionSystem());
world.setSystem(new MovementSystem());
world.initialize();
/*
GUIUtil.createSpriteGUI(Name.INVENTORY + "-background", 0, 0, .5f, 0,
0, Name.INVENTORY, new CGUIFunction() {
@Override
public void onEnter(Entity host, int x, int y) {
System.out.println("Enter");
}
@Override
public void onLeave(Entity host, int x, int y) {
System.out.println("Leave");
}
@Override
public void onPressed(Entity host, int x, int y) {
System.out.println("Pressed");
}
@Override
public void onReleased(Entity host, int x, int y) {
System.out.println("Released");
}
});
*/
/* GUI Example:
GUIUtil.createSpriteGUI(Name.DEFAULT, 0, 0, 0, 0, 16, 32, 0,
Name.DEFAULT, new CGUIFunction() {
@Override
public void onEnter(Entity host, int x, int y) {
System.out.println("entered!");
}
@Override
public void onLeave(Entity host, int x, int y) {
System.out.println("left!");
}
@Override
public void onPressed(Entity host, int x, int y) {
System.out.println("pressed!");
}
@Override
public void onReleased(Entity host, int x, int y) {
System.out.println("released!");
}
});
*/
MapLoader.loadMap("levels/level.tmx");
}
示例8: MainScreen
import com.artemis.World; //导入方法依赖的package包/类
public MainScreen() {
world = new World();
// MANAGERS
world.setManager(new GroupManager());
world.setManager(new TagManager());
world.setManager(new UuidEntityManager());
world.setSystem(new EntityFactorySystem());
world.setSystem(new AssetSystem());
world.setSystem(new CameraSystem(CAMERA_ZOOM_FACTOR));
// LOGIC
world.setSystem(new BuoySystem());
world.setSystem(new LiquidLogicSystem());
world.setSystem(new PlayerControlSystem());
world.setSystem(new PhysicsSystem());
world.setSystem(new ClampedSystem());
world.setSystem(new AttachmentSystem());
world.setSystem(new RippleSystem());
// RENDER
RenderBatchingSystem batchingSystem = new RenderBatchingSystem();
world.setSystem(batchingSystem);
world.setSystem(new AnimRenderSystem(batchingSystem),false);
world.setSystem(new LiquidRenderSystem(batchingSystem), false);
world.initialize();
}