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


Java World.setSystem方法代码示例

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


在下文中一共展示了World.setSystem方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
 
开发者ID:bmaxwell921,项目名称:SwapShip,代码行数:21,代码来源:GameScreen.java

示例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();
}
 
开发者ID:fauu,项目名称:HelixEngine,代码行数:28,代码来源:Overworld.java

示例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());
}
 
开发者ID:fauu,项目名称:HelixEngine,代码行数:35,代码来源:Overworld.java

示例4: startGame

import com.artemis.World; //导入方法依赖的package包/类
private void startGame() {
  world = new World();
  batch = new SpriteBatch();

  world.setSystem(new SpriteAnimationSystem());
  world.setSystem(new ScaleAnimationSystem());
  world.setSystem(new ExpiringSystem());
  world.setSystem(new ColorAnimationSystem());
  world.initialize();

  // this screen can modify the settings instance
  customScreen = new CustomizeGameMenuScreen(this, world, batch, settings);
  menuScreen = new MainMenuScreen(this, world, batch, customScreen);
  setScreen(menuScreen);
}
 
开发者ID:guillaume-alvarez,项目名称:ShapeOfThingsThatWere,代码行数:16,代码来源:ThingsThatWereGame.java

示例5: 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();
	
}
 
开发者ID:Teascade,项目名称:Shadow-of-Goritur,代码行数:34,代码来源:SOGServer.java

示例6: prepareWorld

import com.artemis.World; //导入方法依赖的package包/类
private static World prepareWorld (int numEntities) {
	World world = new World();

	world.setSystem(new MovementSystem());
	world.setSystem(new StateSystem());
	world.setSystem(new CollisionSystem());
	world.setSystem(new RemovalSystem());

	world.initialize();

	for (int i = 0; i < numEntities; ++i) {
		Entity entity = world.createEntity();

		if (Constants.shouldHaveComponent(ComponentType.POSITION, i)) {
			PositionComponent pos = new PositionComponent();
			pos.pos.x = MathUtils.random(Constants.MIN_POS, Constants.MAX_POS);
			pos.pos.y = MathUtils.random(Constants.MIN_POS, Constants.MAX_POS);
			entity.addComponent(pos);
		}

		if (Constants.shouldHaveComponent(ComponentType.MOVEMENT, i)) {
			MovementComponent mov = new MovementComponent();
			mov.velocity.x = MathUtils.random(Constants.MIN_VEL, Constants.MAX_VEL);
			mov.velocity.y = MathUtils.random(Constants.MIN_VEL, Constants.MAX_VEL);
			mov.accel.x = MathUtils.random(Constants.MIN_ACC, Constants.MAX_ACC);
			mov.accel.y = MathUtils.random(Constants.MIN_ACC, Constants.MAX_ACC);

			entity.addComponent(mov);
		}

		if (Constants.shouldHaveComponent(ComponentType.RADIUS, i)) {
			RadiusComponent rad = new RadiusComponent();
			rad.radius = MathUtils.random(Constants.MIN_RADIUS, Constants.MAX_RADIUS);
			entity.addComponent(rad);
		}

		if (Constants.shouldHaveComponent(ComponentType.STATE, i)) {
			entity.addComponent(new StateComponent());
		}

		world.addEntity(entity);
	}

	return world;
}
 
开发者ID:DevelopersGuild,项目名称:Planetbase,代码行数:46,代码来源:ArtemisBenchmark.java

示例7: 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();
}
 
开发者ID:UoLCompSoc,项目名称:mobius,代码行数:55,代码来源:MobiusListingGame.java

示例8: 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);
}
 
开发者ID:guillaume-alvarez,项目名称:ShapeOfThingsThatWere,代码行数:77,代码来源:OverworldScreen.java

示例9: 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");
}
 
开发者ID:Teascade,项目名称:Shadow-of-Goritur,代码行数:65,代码来源:SOGClient.java

示例10: prepareWorld

import com.artemis.World; //导入方法依赖的package包/类
private static World prepareWorld(int numEntities) {
    World world = new World();

    world.setSystem(new MovementSystem());
    world.setSystem(new StateSystem());
    world.setSystem(new CollisionSystem());
    world.setSystem(new RemovalSystem());

    world.initialize();

    for (int i = 0; i < numEntities; ++i) {
        Entity entity = world.createEntity();

        if (Constants.shouldHaveComponent(ComponentType.POSITION, i)) {
            PositionComponent pos = new PositionComponent();
            pos.pos.x = MathUtils.random(Constants.MIN_POS, Constants.MAX_POS);
            pos.pos.y = MathUtils.random(Constants.MIN_POS, Constants.MAX_POS);
            entity.addComponent(pos);
        }

        if (Constants.shouldHaveComponent(ComponentType.MOVEMENT, i)) {
            MovementComponent mov = new MovementComponent();
            mov.velocity.x = MathUtils.random(Constants.MIN_VEL, Constants.MAX_VEL);
            mov.velocity.y = MathUtils.random(Constants.MIN_VEL, Constants.MAX_VEL);
            mov.accel.x = MathUtils.random(Constants.MIN_ACC, Constants.MAX_ACC);
            mov.accel.y = MathUtils.random(Constants.MIN_ACC, Constants.MAX_ACC);

            entity.addComponent(mov);
        }

        if (Constants.shouldHaveComponent(ComponentType.RADIUS, i)) {
            RadiusComponent rad = new RadiusComponent();
            rad.radius = MathUtils.random(Constants.MIN_RADIUS, Constants.MAX_RADIUS);
            entity.addComponent(rad);
        }

        if (Constants.shouldHaveComponent(ComponentType.STATE, i)) {
            entity.addComponent(new StateComponent());
        }

        world.addEntity(entity);
    }

    return world;
}
 
开发者ID:grum,项目名称:Ashley,代码行数:46,代码来源:ArtemisBenchmark.java

示例11: create

import com.artemis.World; //导入方法依赖的package包/类
@Override
public void create() {
	instance = this;
	world = new World();
	world.setSystem(new PlayerInputSystem());
	world.setSystem(new MovementSystem());
	world.setSystem(new OrbitSystem());
	world.setSystem(new ParticleEmitterSystem());
	world.setSystem(new CollisionSystem());
	world.setSystem(new PlayerSystem());
	renderingSystem = new RenderingSystem();
	world.setSystem(renderingSystem);
	particleSystem = new ParticleRenderingSystem(renderingSystem.camera);
	world.setSystem(particleSystem);
	world.initialize();

	EntityManager.setWorld(world);
	
	for (int i = 0; i < 256; i++) {
		EntityManager.createJunkLarge(random.nextInt(32768) - 16384,
				random.nextInt(32768) - 16384);
	}
	for (int i = 0; i < 512; i++) {
		EntityManager.createJunkMedium(random.nextInt(32768) - 16384,
				random.nextInt(32768) - 16384);
	}
	for (int i = 0; i < 1024; i++) {
		EntityManager.createJunkSmall(random.nextInt(32768) - 16384,
				random.nextInt(32768) - 16384);
	}

	for (int x = -1; x < 2; x++) {
		for (int y = -1; y < 2; y++) {
			createStarSystem(16384 * x + random.nextInt(4096) - 2048, 16384
					* y + random.nextInt(4096) - 2048);
		}
	}
	startingPlanet = EntityManager.createPlanet(0, 0);
	
	music = Gdx.audio.newMusic(Gdx.files.internal("music.ogg"));
	music.setLooping(true);
	music.play();
	
	dingLow = Gdx.audio.newSound(Gdx.files.internal("dingLow.ogg"));
	dingMedium = Gdx.audio.newSound(Gdx.files.internal("dingMedium.ogg"));
	dingHigh = Gdx.audio.newSound(Gdx.files.internal("dingHigh.ogg"));
	dingLong = Gdx.audio.newSound(Gdx.files.internal("dingLong.ogg"));
}
 
开发者ID:Jeasonfire,项目名称:galaxies,代码行数:49,代码来源:Galaxies.java

示例12: 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();
    }
 
开发者ID:DaanVanYperen,项目名称:splash-racer,代码行数:40,代码来源:MainScreen.java


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