本文整理汇总了Java中com.badlogic.ashley.core.Engine.addEntityListener方法的典型用法代码示例。如果您正苦于以下问题:Java Engine.addEntityListener方法的具体用法?Java Engine.addEntityListener怎么用?Java Engine.addEntityListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.ashley.core.Engine
的用法示例。
在下文中一共展示了Engine.addEntityListener方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addedToEngine
import com.badlogic.ashley.core.Engine; //导入方法依赖的package包/类
@Override
public void addedToEngine(Engine engine) {
super.addedToEngine(engine);
syncedEntities = engine.getEntitiesFor(Family.all(PlayerClass.class).get());
engine.addEntityListener(Family.all(NetworkAddComponent.class).get(), this);
player = engine.getEntitiesFor(Family.all(NetworkSyncComponent.class, PlayerClass.class, IdComponent.class).get());
}
示例2: addedToEngine
import com.badlogic.ashley.core.Engine; //导入方法依赖的package包/类
@Override
public void addedToEngine (Engine engine) {
ImmutableArray<Entity> newEntities = engine.getEntitiesFor(family);
sortedEntities.clear();
if (newEntities.size() > 0) {
for (int i = 0; i < newEntities.size(); ++i) {
sortedEntities.add(newEntities.get(i));
}
sortedEntities.sort(comparator);
}
shouldSort = false;
engine.addEntityListener(family, this);
}
示例3: addedToEngine
import com.badlogic.ashley.core.Engine; //导入方法依赖的package包/类
public void addedToEngine (Engine engine)
{
super.addedToEngine(engine);
engine.addEntityListener(family, Integer.MAX_VALUE, this);
doors = engine.getEntitiesFor(family);
doorsToOpen = new Array<Entity>();
doorsToClose = new Array<Entity>();
}
示例4: addedToEngine
import com.badlogic.ashley.core.Engine; //导入方法依赖的package包/类
@Override
public void addedToEngine(Engine engine) {
super.addedToEngine(engine);
observables = engine.getEntitiesFor(
Family.all(ObservableComponent.class).get()
);
engine.addEntityListener(getFamily(), this);
}
示例5: Systems
import com.badlogic.ashley.core.Engine; //导入方法依赖的package包/类
public Systems(Engine engine){
engine.addSystem(physics);
engine.addSystem(agent);
engine.addSystem(camera);
engine.addSystem(move);
engine.addSystem(player);
engine.addSystem(weapon);
engine.addSystem(lifetime);
engine.addSystem(vision);
//engine.addSystem(rangedGroundAI);
//engine.addSystem(civilianGroundAI);
engine.addSystem(spriteRender);
engine.addSystem(team);
engine.addSystem(collectable);
engine.addSystem(spawn);
engine.addSystem(damage);
engine.addSystem(particle);
//engine.addSystem(helicopterAI);
engine.addSystem(vehicle);
engine.addEntityListener(camera);
engine.addEntityListener(physics);
engine.addEntityListener(player);
engine.addEntityListener(spriteRender);
}
示例6: addedToEngine
import com.badlogic.ashley.core.Engine; //导入方法依赖的package包/类
@Override
// Overriden so this object can register itself to listen to entity removal
// notifications - so it can actually kill animations for entities that are
// gone
public void addedToEngine(Engine engine) {
super.addedToEngine(engine);
engine.addEntityListener(this);
}
示例7: EntityManager
import com.badlogic.ashley.core.Engine; //导入方法依赖的package包/类
public EntityManager(Engine ashleyEngine, SpriteBatch batch, OrthographicCamera gameCamera,
InputHandler inputhandler, UiStage _uiStage, GameStateManager gsm,EntityFactory entityFactory) {
this._ashleyEngine = ashleyEngine;
this.inputhandler = inputhandler;
setEntityFactory(entityFactory);
EntityModel _entityModel = new EntityModel(_waveManager, getEntityFactory(), gameCamera, ashleyEngine);
uiController = new UIStageController(_uiStage , _entityModel, gsm);
getEntityFactory().createPlayerEntity();
_waveManager = new WaveTimeManager(getEntityFactory() , uiController);
MoveToSystem moveToSystem = new MoveToSystem(gameCamera);
coinSystem = new CoinSystem(gameCamera);
PlayerStatSystem statSystem = new PlayerStatSystem(uiController, _entityModel);
TowerPlacementSystem towerSystem = new TowerPlacementSystem(batch);
ShootingSystem shootingSystem = new ShootingSystem(entityFactory);
ProjectileMovementSystem projectileMovementSystem = new ProjectileMovementSystem();
AimingSystem aimingSystem = new AimingSystem();
RenderSystem renderSystem = new RenderSystem(batch);
HealthSystem healthSystem = new HealthSystem(batch, getEntityFactory());
PlayerInputSystem playerInputSys = new PlayerInputSystem();
inputhandler.registerInputHandlerSystem(playerInputSys);
CameraMovementSystem camSys = new CameraMovementSystem(gameCamera);
TowerSelectionSystem towerSelectSystem = new TowerSelectionSystem(getEntityFactory(), gameCamera);
SpriteRenderSystem spriteRenderSystem = new SpriteRenderSystem(batch);
SplashDamageSystem splashDamageSystem = new SplashDamageSystem();
ashleyEngine.addSystem(statSystem);
ashleyEngine.addSystem(towerSelectSystem);
ashleyEngine.addSystem(moveToSystem);
ashleyEngine.addSystem(towerSystem);
ashleyEngine.addSystem(spriteRenderSystem);
ashleyEngine.addSystem(renderSystem);
ashleyEngine.addSystem(healthSystem);
ashleyEngine.addSystem(playerInputSys);
ashleyEngine.addSystem(camSys);
ashleyEngine.addSystem(coinSystem);
ashleyEngine.addSystem(splashDamageSystem);
ashleyEngine.addSystem(shootingSystem);
ashleyEngine.addSystem(projectileMovementSystem);
ashleyEngine.addSystem(aimingSystem);
ashleyEngine.addEntityListener(Families.PROJECTILE,splashDamageSystem);
ashleyEngine.addEntityListener(Families.ENEMY, projectileMovementSystem);
}
示例8: addedToEngine
import com.badlogic.ashley.core.Engine; //导入方法依赖的package包/类
@Override
public void addedToEngine(Engine engine) {
engine.addEntityListener(Family.all(BuildingComponent.class).get(), this);
}
示例9: addedToEngine
import com.badlogic.ashley.core.Engine; //导入方法依赖的package包/类
@Override
public void addedToEngine(Engine engine) {
super.addedToEngine(engine);
engine.addEntityListener(CAM_FAMILY, mainCamSetter);
fs = engine.getSystem(FlockingSystem.class);
}
示例10: addedToEngine
import com.badlogic.ashley.core.Engine; //导入方法依赖的package包/类
@Override
public void addedToEngine(Engine engine)
{
super.addedToEngine(engine);
engine.addEntityListener(getFamily(), this);
}
示例11: addedToEngine
import com.badlogic.ashley.core.Engine; //导入方法依赖的package包/类
@Override
public void addedToEngine(Engine engine) {
super.addedToEngine(engine);
engine.addEntityListener(family, Integer.MAX_VALUE, this);
entities = engine.getEntitiesFor(family);
}
示例12: addedToEngine
import com.badlogic.ashley.core.Engine; //导入方法依赖的package包/类
@Override
public void addedToEngine(Engine engine) {
super.addedToEngine(engine);
engine.addEntityListener(getFamily(), this);
}
示例13: addedToEngine
import com.badlogic.ashley.core.Engine; //导入方法依赖的package包/类
@Override
public void addedToEngine(Engine engine) {
super.addedToEngine(engine);
engine.addEntityListener(family, Integer.MAX_VALUE, this);
}
示例14: addedToEngine
import com.badlogic.ashley.core.Engine; //导入方法依赖的package包/类
@Override
public void addedToEngine(Engine engine) {
super.addedToEngine(engine);
engine.addEntityListener(getFamily(), 0, this);
}
示例15: addedToEngine
import com.badlogic.ashley.core.Engine; //导入方法依赖的package包/类
@Override
public void addedToEngine(Engine engine) {
Family family = Family.all(PositionComponent.class, AnimationComponent.class).get();
engine.addEntityListener(family, this);
}