本文整理汇总了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);
}
示例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");
}
示例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;
}
示例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");
}
}
示例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();
}
示例6: initialize
import com.artemis.ComponentMapper; //导入方法依赖的package包/类
public void initialize(World world) {
expiresMapper = ComponentMapper.getFor(Expires.class, world);
this.world = world;
}
示例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);
}
示例8: initialize
import com.artemis.ComponentMapper; //导入方法依赖的package包/类
@Override
public void initialize() {
inputMapper = ComponentMapper.getFor(Input.class, world);
bodyMapper = ComponentMapper.getFor(PhysicsBodyComponent.class, world);
}
示例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);
}
示例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);
}
示例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();
}