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


Java ComponentMapper.getFor方法代码示例

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


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

示例1: ComponentMappers

import com.artemis.ComponentMapper; //导入方法依赖的package包/类
private ComponentMappers(final World world) {
	facing = ComponentMapper.getFor(FacingComponent.class, world);
	health = ComponentMapper.getFor(HealthComponent.class, world);
	position = ComponentMapper.getFor(PositionComponent.class, world);
	animation = ComponentMapper.getFor(AnimationComponent.class, world);
	facingAnimation = ComponentMapper.getFor(FacingAnimationComponent.class, world);
	sprite = ComponentMapper.getFor(SpriteComponent.class, world);
	name = ComponentMapper.getFor(NameComponent.class, world);
	highlight = ComponentMapper.getFor(HighlightAbleComponent.class, world);
	camera = ComponentMapper.getFor(CameraFollowComponent.class, world);
	collectible = ComponentMapper.getFor(CollectibleComponent.class, world);
	player = ComponentMapper.getFor(PlayerComponent.class, world);
	cursor = ComponentMapper.getFor(CursorComponent.class, world);
	turn = ComponentMapper.getFor(TurnComponent.class, world);
	ai = ComponentMapper.getFor(ArtificialIntelligenceComponent.class, world);
}
 
开发者ID:davidbecker,项目名称:taloonerrl,代码行数:17,代码来源:ComponentMappers.java

示例2: initialize

import com.artemis.ComponentMapper; //导入方法依赖的package包/类
@Override
  public void initialize(){
      expiresMapper   = ComponentMapper.getFor(Expires.class, world);
      transformMapper = ComponentMapper.getFor(Transform.class, world);
      shooterMapper   = ComponentMapper.getFor(Shooter.class, world);
      playerMapper   	= ComponentMapper.getFor(Player.class, world);
      inputMapper   	= ComponentMapper.getFor(Input.class, world);

      Entity timeToLiveDisplay = EntityFactoryLD27.newTimeToLiveDisplay(world, 2, 0, 280, "");
      timeToLiveDisplay.addToWorld();
      timeToLiveDisplayComponent = timeToLiveDisplay.getComponent(TextComponent.class);
      KeyBindings.addKey(Keys.LEFT, "move_left");
KeyBindings.addKey(Keys.RIGHT, "move_right");
KeyBindings.addKey(Keys.UP, "move_up");
KeyBindings.addKey(Keys.DOWN, "move_down");

KeyBindings.addKey(Keys.Q, "move_left");
KeyBindings.addKey(Keys.D, "move_right");
KeyBindings.addKey(Keys.Z, "move_up");
KeyBindings.addKey(Keys.S, "move_down");
  }
 
开发者ID:akohen,项目名称:Merkurius-LD27,代码行数:22,代码来源:LD27PlayerSystem.java

示例3: initialize

import com.artemis.ComponentMapper; //导入方法依赖的package包/类
public void initialize(World world) {
	expiresMapper = ComponentMapper.getFor(Expires.class, world);
	parentMapper = ComponentMapper.getFor(Parent.class, world);
	actorMapper = ComponentMapper.getFor(Actor.class, world);
	
	this.world 	= world;
}
 
开发者ID:akohen,项目名称:Merkurius-LD27,代码行数:8,代码来源:BulletAction.java

示例4: initialize

import com.artemis.ComponentMapper; //导入方法依赖的package包/类
protected void initialize() {
	super.initialize();
	transformMapper = ComponentMapper.getFor(Transform.class, world);
       velocityMapper  = ComponentMapper.getFor(Velocity.class, world);
       shooterMapper   = ComponentMapper.getFor(Shooter.class, world);
       playerMapper   	= ComponentMapper.getFor(Player.class, world);
       parentMapper   	= ComponentMapper.getFor(Parent.class, world);
	inputMapper 	= ComponentMapper.getFor(Input.class, world);
       
       
       playerSystem	= Systems.get(PlayerSystem.class, world);
       if ( playerSystem == null ) {
		throw new RuntimeException("Required System not loaded");
	} 
}
 
开发者ID:akohen,项目名称:Merkurius-LD27,代码行数:16,代码来源:LD27SyncSystem.java

示例5: initialize

import com.artemis.ComponentMapper; //导入方法依赖的package包/类
@Override
public void initialize(){
    transformMapper = ComponentMapper.getFor(Transform.class, world);
    shooterMapper   = ComponentMapper.getFor(Shooter.class, world);
    playerMapper   	= ComponentMapper.getFor(Player.class, world);
    inputMapper   	= ComponentMapper.getFor(Input.class, world);
    refreshList();
}
 
开发者ID:akohen,项目名称:Merkurius-LD27,代码行数:9,代码来源:LD27ServerListSystem.java

示例6: initialize

import com.artemis.ComponentMapper; //导入方法依赖的package包/类
public void initialize(World world) {
	expiresMapper = ComponentMapper.getFor(Expires.class, world);
	
	this.world 	= world;
}
 
开发者ID:akohen,项目名称:Merkurius-LD27,代码行数:6,代码来源:BulletClientAction.java

示例7: initialize

import com.artemis.ComponentMapper; //导入方法依赖的package包/类
@Override
public void initialize(){
    transformMapper = ComponentMapper.getFor(Transform.class, world);
    shooterMapper   = ComponentMapper.getFor(Shooter.class, world);
    velocityMapper  = ComponentMapper.getFor(Velocity.class, world);
}
 
开发者ID:akohen,项目名称:Merkurius-LD27,代码行数:7,代码来源:NpcSystem.java

示例8: initialize

import com.artemis.ComponentMapper; //导入方法依赖的package包/类
@Override
public void initialize() {
	inputMapper 	= ComponentMapper.getFor(Input.class, world);
	bodyMapper 	= ComponentMapper.getFor(PhysicsBodyComponent.class, world);
}
 
开发者ID:akohen,项目名称:Merkurius-LD27,代码行数:6,代码来源:LD27InputSystem.java

示例9: initialize

import com.artemis.ComponentMapper; //导入方法依赖的package包/类
@Override
protected void initialize() {
	transformMapper = ComponentMapper.getFor(Transform.class, world);
	velocityMapper 	= ComponentMapper.getFor(Velocity.class, world);
	bodyMapper 		= ComponentMapper.getFor(PhysicsBodyComponent.class, world);
}
 
开发者ID:akohen,项目名称:Merkurius-LD27,代码行数:7,代码来源:ScaledBox2DSystem.java

示例10: initialize

import com.artemis.ComponentMapper; //导入方法依赖的package包/类
@Override
public void initialize() {
	visualMapper 	= ComponentMapper.getFor(VisualComponent.class, world);
	velocityMapper 	= ComponentMapper.getFor(Velocity.class, world);
	shooterMapper 	= ComponentMapper.getFor(Shooter.class, world);
}
 
开发者ID:akohen,项目名称:Merkurius-LD27,代码行数:7,代码来源:LD27AnimationSystem.java

示例11: processSystem

import com.artemis.ComponentMapper; //导入方法依赖的package包/类
@Override
protected void processSystem() {
	
	//Logger.dbg("tick " + this);
	
	Game_AI_TestBed game = Game_AI_TestBed.instance();
	Level level = game.getActiveLevel();
	
	level.setStateTime(level.getStateTime() + level.getWorld().getDelta());
	
	//game.getCamera().position.x += 1;
	//camera.position.y += 1;
	game.getCamera().zoom = 1.4F;
	//game.getCamera().zoom = 3F;
	game.getCamera().update();
	
	ComponentMapper<Position> mapPos = ComponentMapper.getFor(Position.class, level.getWorld());
	Entity player = level.getPlayerEntity();
	
	if (player != null) {
		Position pos = mapPos.get(player);
		
		float partialTick = level.getPartialTick();
		
		float rX = pos.prevX + (pos.x - pos.prevX) * partialTick;
		float rY = pos.prevY + (pos.y - pos.prevY) * partialTick;
		
		game.getCamera().position.x = rX;
		game.getCamera().position.y = rY;
		
		//System.out.println(pos.x + " - " + pos.y);
	}
	
	
	
	Color color = new Color(0, 0, 0, 0);
	
	//clear screen
	Gdx.gl.glClearColor(color.r, color.g,color.b,color.a);
	Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
	
	//update map position and render
	level.getMapRenderer().setView(game.getCamera());
	level.getMapRenderer().render();
	
}
 
开发者ID:Corosauce,项目名称:AI_TestBed_v3,代码行数:47,代码来源:MapRender.java


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