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


Java Aspect类代码示例

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


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

示例1: RenderSystem

import com.artemis.Aspect; //导入依赖的package包/类
public RenderSystem(DecalBatch decalBatch, AssetManager assetManager, float worldDegree, Assets.LevelAssets assets) {
    super(Aspect.all(RenderComponent.class, PositionComponent.class));
    this.levelAssets = assets;
    decalMap = new ObjectMap<>();
    uiMap = new ObjectMap<>();
    this.decalBatch = decalBatch;
    this.assetManager = assetManager;
    buffers = new ObjectMap<>();

    this.spriteBatch = new SpriteBatch();
    this.font = assets.uifont;
    font.setColor(Color.BLACK);
    this.uiCamera = new OrthographicCamera();

    Viewport viewportUi = new FitViewport(levelAssets.health_bar_gradient.getWidth(), levelAssets.health_bar_gradient.getHeight(), uiCamera);
    viewportUi.update(viewportUi.getScreenWidth(), viewportUi.getScreenHeight(), true);

    stateTime = 0;
    this.worldDegree = worldDegree;

    gradientShader = new ShaderProgram(Shaders.GradientShader.vertexShader, Shaders.GradientShader.fragmentShader);
    if (gradientShader.isCompiled() == false)
        throw new IllegalArgumentException("couldn't compile shader: " + gradientShader.getLog());
    shaderBatch = new SpriteBatch(10, gradientShader);
}
 
开发者ID:EtherWorks,项目名称:arcadelegends-gg,代码行数:26,代码来源:RenderSystem.java

示例2: toggleHighlightedActors

import com.artemis.Aspect; //导入依赖的package包/类
/**
 * toggles highlighted state of actor that is on the same tile as the mouse is
 * over
 */
private boolean toggleHighlightedActors() {
	boolean toggled = false;
	@SuppressWarnings("unchecked")
	final EntitySubscription entitySubscription = GameEngine.getInstance().getAspectSubscriptionManager()
			.get(Aspect.all(PositionComponent.class, HighlightAbleComponent.class)
					.exclude(CursorComponent.class));
	final IntBag entities = entitySubscription.getEntities();
	PositionComponent positionComponent;
	HighlightAbleComponent highlight;
	for (int i = 0; i < entities.size(); i++) {
		positionComponent = ComponentMappers.getInstance().position.get(i);
		if (positionComponent.getX() == mouseOverX && positionComponent.getY() == mouseOverY) {
			highlight = ComponentMappers.getInstance().highlight.get(i);
			highlight.toggleHighlighted();
			toggled = true;
		}
	}
	return toggled;
}
 
开发者ID:davidbecker,项目名称:taloonerrl,代码行数:24,代码来源:InputSystem.java

示例3: processTurnTaken

import com.artemis.Aspect; //导入依赖的package包/类
/**
 * checks if all entities have their turn taken for the current turn
 *
 * @param _currentTurnSide
 */
private void processTurnTaken() {
	if (checkReadyToSwitchTurns()) {
		// reset turn components
		final IntBag entities = getAspectSubscriptionManager().get(Aspect.all(TurnComponent.class))
				.getEntities();
		TurnComponent turnComponent;
		for (int i = 0; i < entities.size(); i++) {
			turnComponent = ComponentMappers.getInstance().turn.get(entities.get(i));
			if (turnComponent.getMovesOnTurn() == currentTurnSide) {
				turnComponent.setTurnTaken(false);
				turnComponent.setProcessed(false);
			}
		}
		// switch sides
		currentTurnSide = currentTurnSide == ETurnType.PLAYER ? ETurnType.MONSTER : ETurnType.PLAYER;
		Gdx.app.debug("GameEngine", "switching turn sides to " + ETurnType.toString(currentTurnSide));
	}
}
 
开发者ID:davidbecker,项目名称:taloonerrl,代码行数:24,代码来源:GameEngine.java

示例4: collides

import com.artemis.Aspect; //导入依赖的package包/类
private boolean collides(final float x, final float y) {
     //E().pos(x - 1, y - 1).anim("player-idle").render(2000);

    for (E e : allEntitiesMatching(Aspect.all(Platform.class))) {
        if (overlaps(e, x, y)) return true;
    }

    return false;
}
 
开发者ID:DaanVanYperen,项目名称:odb-artax,代码行数:10,代码来源:PlatformCollisionSystem.java

示例5: firstTouchingEntityMatching

import com.artemis.Aspect; //导入依赖的package包/类
protected E firstTouchingEntityMatching(E subject, Aspect.Builder scope) {
    for (E e : allEntitiesMatching(scope)) {
        if (overlaps(e, subject))
            return e;
    }
    return null;
}
 
开发者ID:DaanVanYperen,项目名称:odb-artax,代码行数:8,代码来源:FluidIteratingSystem.java

示例6: CharacterSystem

import com.artemis.Aspect; //导入依赖的package包/类
public CharacterSystem(World world) {
    super(Aspect.all(CharacterComponent.class, PositionComponent.class, PhysicComponent.class, StatComponent.class));
    this.world = world;
    vectorPool = new Pool<Vector2>() {
        @Override
        protected Vector2 newObject() {
            return new Vector2();
        }

        @Override
        protected void reset(Vector2 vector) {
            vector.set(0, 0);
        }
    };
}
 
开发者ID:EtherWorks,项目名称:arcadelegends-gg,代码行数:16,代码来源:CharacterSystem.java

示例7: deleteInhabitants

import com.artemis.Aspect; //导入依赖的package包/类
private void deleteInhabitants() {
    IntBag entities = world.getAspectSubscriptionManager().get(Aspect.all(Planetbound.class)).getEntities();
    int[] ids = entities.getData();
    for (int i = 0, s = entities.size(); s > i; i++) {
        E e = E.E(ids[i]);
        e.deleteFromWorld();
    }
}
 
开发者ID:DaanVanYperen,项目名称:odb-little-fortune-planet,代码行数:9,代码来源:PlanetCreationSystem.java

示例8: process

import com.artemis.Aspect; //导入依赖的package包/类
@Override
protected void process(E e) {
    if (e.explosivePrimed()) {
        int cx = (int) (e.posX() + e.boundsCx());
        int cy = (int) (e.posY() + e.boundsCy());
        drawingSystem.draw(planetCreationSystem.planetEntity,
                cx, cy,
                e.explosiveYield(),
                PlanetCell.CellType.FIRE);
        e.deleteFromWorld();

        for (E wanderer : allEntitiesMatching(Aspect.all(Wander.class, Pos.class, Physics.class))) {

            v2.set(wanderer.posX(), wanderer.posY()).sub(cx, cy);

            float len = Math.abs(v2.len());
            if (len < 100) {
                float strength = MathUtils.clamp(0, 220 - len, 100);
                v2.nor().scl(strength);

                v3.set(wanderer.posX(), wanderer.posY()).sub(G.PLANET_CENTER_X, G.PLANET_CENTER_Y).nor().scl(strength / 2);

                v2.add(v3);

                wanderer.physicsVx(v2.x);
                wanderer.physicsVy(v2.y);
            }
        }
    }
}
 
开发者ID:DaanVanYperen,项目名称:odb-little-fortune-planet,代码行数:31,代码来源:ExplosiveSystem.java

示例9: reset

import com.artemis.Aspect; //导入依赖的package包/类
public void reset() {
    IntBag cards = world.getAspectSubscriptionManager().get(Aspect.all(StatusEffect.class)).getEntities();
    int[] ids = cards.getData();
    for (int i = 0, s = cards.size(); s > i; i++) {
        E.E(ids[i]).deleteFromWorld();
    }
    spawnSkyscrapers();
}
 
开发者ID:DaanVanYperen,项目名称:odb-little-fortune-planet,代码行数:9,代码来源:CardScriptSystem.java

示例10: timeoutEffects

import com.artemis.Aspect; //导入依赖的package包/类
private void timeoutEffects() {
    IntBag cards = world.getAspectSubscriptionManager().get(Aspect.all(StatusEffect.class)).getEntities();
    int[] ids = cards.getData();
    for (int i = 0, s = cards.size(); s > i; i++) {
        E e = E.E(ids[i]);
        StatusEffect statusEffect = e.getStatusEffect();
        statusEffect.duration--;
        if (statusEffect.duration < 0) {
            e.deleteFromWorld();
        }
        break;
    }
}
 
开发者ID:DaanVanYperen,项目名称:odb-little-fortune-planet,代码行数:14,代码来源:CardScriptSystem.java

示例11: triggerExplosives

import com.artemis.Aspect; //导入依赖的package包/类
public void triggerExplosives() {
    boolean found = false;
    for (E e : allEntitiesMatching(Aspect.all(Explosive.class))) {
        e.explosivePrimed(true);
        found = true;
    }
    if (found) {
        gameScreenAssetSystem.playSfx("LD_lowfi_explosion");
    }
}
 
开发者ID:DaanVanYperen,项目名称:odb-little-fortune-planet,代码行数:11,代码来源:CardScriptSystem.java

示例12: kill

import com.artemis.Aspect; //导入依赖的package包/类
public void kill() {
    IntBag actives = world.getAspectSubscriptionManager().get(Aspect.all(Ancient.class)).getEntities();
    int[] ids = actives.getData();
    for (int i = 0, s = actives.size(); s > i; i++) {
        int entity = ids[i];
        mSchedule.create(entity).operation.add(
                OperationFactory.sequence(
                        OperationFactory.tween(new Tint(mColor.get(entity).color), invis, 0.5f),
                        OperationFactory.deleteFromWorld()
                ));
    }
}
 
开发者ID:DaanVanYperen,项目名称:odb-dynasty,代码行数:13,代码来源:FireballSystem.java

示例13: ThreadedIteratingSystem

import com.artemis.Aspect; //导入依赖的package包/类
public ThreadedIteratingSystem(Aspect.Builder aspect, Threading threading) {
    super(aspect);
    this.threading = threading;

    latchId = 2165;
    threading.createLatch(latchId, Threading.cores);
}
 
开发者ID:MovementSpeed,项目名称:nhglib,代码行数:8,代码来源:ThreadedIteratingSystem.java

示例14: PhysicsSystem

import com.artemis.Aspect; //导入依赖的package包/类
public PhysicsSystem() {
    super(Aspect
            .all(NodeComponent.class)
            .one(RigidBodyComponent.class, VehicleComponent.class, WheelComponent.class));

    initPhysics();
}
 
开发者ID:MovementSpeed,项目名称:nhglib,代码行数:8,代码来源:PhysicsSystem.java

示例15: UiSystem

import com.artemis.Aspect; //导入依赖的package包/类
public UiSystem(Entities entities) {
    super(Aspect.all(UiComponent.class), entities);

    supportedRes = new ArrayList<>();
    supportedRes.add(new Vector2(1280, 720));
    supportedRes.add(new Vector2(1920, 1080));

    uiComponents = new Array<>();
}
 
开发者ID:MovementSpeed,项目名称:nhglib,代码行数:10,代码来源:UiSystem.java


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