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


Java IntBag.getData方法代码示例

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


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

示例1: killCheapestUnit

import com.artemis.utils.IntBag; //导入方法依赖的package包/类
public void killCheapestUnit() {

        int productivity = 999;
        int cheapestId=-1;

        IntBag actives = subscription.getEntities();
        int[] ids = actives.getData();
        for (int i = 0, s = actives.size(); s > i; i++) {
            int entity = ids[i];
            Minion minion = mMinion.get(entity);
            if ( minion.productivity < productivity && !mSchedule.has(entity) )
            {
                productivity = minion.productivity;
                cheapestId = entity;
            }
        }

        if ( cheapestId != -1 )
        {
            explode(cheapestId);
        }
    }
 
开发者ID:DaanVanYperen,项目名称:odb-dynasty,代码行数:23,代码来源:MinionSystem.java

示例2: dispose

import com.artemis.utils.IntBag; //导入方法依赖的package包/类
@Override
public void dispose() {
    physicsInitialized = false;

    IntBag entityIds = getEntityIds();
    for (int entity : entityIds.getData()) {
        RigidBodyComponent bodyComponent = rigidBodyMapper.get(entity);

        if (bodyComponent != null) {
            bodyComponent.dispose();
        }
    }

    dynamicsWorld.dispose();
    constraintSolver.dispose();
    collisionConfiguration.dispose();
    collisionDispatcher.dispose();
    dbvtBroadphase.dispose();
}
 
开发者ID:MovementSpeed,项目名称:nhglib,代码行数:20,代码来源:PhysicsSystem.java

示例3: processSystem

import com.artemis.utils.IntBag; //导入方法依赖的package包/类
/**
 * Iterate over all entities.
 *
 * Stop when allotted time has passed.
 * Stop when all entities have been cycled.
 */
@Override
protected final void processSystem() {

	final IntBag actives = subscription.getEntities();
	final int[] array = actives.getData();

	final int size = actives.size();
	int processed = 0;
	if ( size > 0 ) {

		long time = getTime();
		final long deadline = time + (long) (getAllottedTime() * MILLISECONDS_PER_SECOND);

		index = index % size; // avoid breakage upon subscription changes.
		while ((processed < size) && (time < deadline)) {
			lastProcessedEntityId = array[index];
			process(lastProcessedEntityId);
			index = ++index % size;
			processed++;
			time = getTime();
		}
	}
	processedEntities = processed;
}
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:31,代码来源:TimeboxedProcessingSystem.java

示例4: reloadFonts

import com.artemis.utils.IntBag; //导入方法依赖的package包/类
public void reloadFonts (boolean reloadBmpFonts, boolean reloadTtfFonts) {
	IntBag bag = subscription.getEntities();
	int[] data = bag.getData();

	for (int i = 0; i < bag.size(); i++) {
		int id = data[i];
		Entity entity = world.getEntity(id);

		VisText text = textCm.get(entity);
		VisAssetDescriptor asset = assetCm.get(entity).asset;

		if (asset instanceof BmpFontAsset && reloadBmpFonts)
			text.setFont(fontCache.get((BmpFontAsset) asset, pixelInUnits));

		if (asset instanceof TtfFontAsset && reloadTtfFonts)
			text.setFont(fontCache.get((TtfFontAsset) asset, pixelInUnits));
	}
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:19,代码来源:FontReloaderManager.java

示例5: reloadTextures

import com.artemis.utils.IntBag; //导入方法依赖的package包/类
public void reloadTextures () {
	IntBag bag = subscription.getEntities();
	int[] data = bag.getData();

	for (int i = 0; i < bag.size(); i++) {
		int id = data[i];
		Entity entity = world.getEntity(id);

		VisSprite sprite = spriteCm.get(entity);
		VisAssetDescriptor asset = assetCm.get(entity).asset;

		boolean flipX = sprite.isFlipX();
		boolean flipY = sprite.isFlipY();
		sprite.setRegion(textureCache.getRegion(asset));
		sprite.setFlip(flipX, flipY);
	}
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:18,代码来源:TextureReloaderManager.java

示例6: reloadParticles

import com.artemis.utils.IntBag; //导入方法依赖的package包/类
public void reloadParticles () {
	IntBag bag = subscription.getEntities();
	int[] data = bag.getData();

	for (int i = 0; i < bag.size(); i++) {
		int id = data[i];
		Entity entity = world.getEntity(id);

		VisParticle particle = particleCm.get(entity);
		VisAssetDescriptor asset = assetCm.get(entity).asset;

		particle.getEffect().dispose();

		particle.setEffect(particleCache.get(asset, 1f / pixelsPerUnit));
		transformCm.get(entity).setDirty(true);
	}
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:18,代码来源:ParticleReloaderManager.java

示例7: getEntitiesWithLayer

import com.artemis.utils.IntBag; //导入方法依赖的package包/类
public ImmutableBag<Entity> getEntitiesWithLayer (int layerId) {
	Bag<Entity> entities = new Bag<Entity>();

	IntBag bag = subscription.getEntities();
	int[] data = bag.getData();

	for (int i = 0; i < bag.size(); i++) {
		int id = data[i];
		Entity entity = world.getEntity(id);
		Layer layer = layerCm.get(entity);

		if (layer.layerId == layerId)
			entities.add(entity);
	}

	return entities;
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:18,代码来源:LayerManipulator.java

示例8: swapLayers

import com.artemis.utils.IntBag; //导入方法依赖的package包/类
/**
 * Swaps layers id in entities. This SHOULD NOT be used directly because it does not update internal layer structure
 * in {@link EditorScene}. Layers order is managed by {@link LayersDialog}
 */
public void swapLayers (int id1, int id2) {
	IntBag bag = subscription.getEntities();
	int[] data = bag.getData();

	for (int i = 0; i < bag.size(); i++) {
		int id = data[i];
		Entity entity = world.getEntity(id);
		Layer layer = layerCm.get(entity);

		if (layer.layerId == id1) layer.layerId = id2;
		else if (layer.layerId == id2) layer.layerId = id1;
	}

	renderBatchingSystem.markDirty();
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:20,代码来源:LayerManipulator.java

示例9: reloadSpriterData

import com.artemis.utils.IntBag; //导入方法依赖的package包/类
public void reloadSpriterData () {
	IntBag bag = subscription.getEntities();
	int[] data = bag.getData();

	for (int i = 0; i < bag.size(); i++) {
		int id = data[i];
		Entity entity = world.getEntity(id);

		VisSpriter spriter = spriterCm.get(entity);
		SpriterAsset asset = (SpriterAsset) assetCm.get(entity).asset;

		VisSpriter newSpriter = spriterCache.cloneComponent(asset, spriter);
		entity.edit().remove(spriter).add(newSpriter);
		transformCm.get(entity).setDirty(true);

		//we've replaced SpriterComponent in entity so proxy needs manual reloading
		entityProxyCache.get(entity).reload();
	}

	spriterCache.disposeOldLoaders();
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:22,代码来源:SpriterReloaderManager.java

示例10: processSystem

import com.artemis.utils.IntBag; //导入方法依赖的package包/类
/**
 * Updates the {@link #stateTime}.
 */
@Override
protected void processSystem() {
    if (stateTime == Float.MAX_VALUE)
        stateTime = 0;
    stateTime += getWorld().getDelta();
    IntBag actives = subscription.getEntities();
    int[] ids = actives.getData();
    for (int i = 0, s = actives.size(); s > i; i++) {
        process(ids[i]);
    }
}
 
开发者ID:EtherWorks,项目名称:arcadelegends-gg,代码行数:15,代码来源:RenderSystem.java

示例11: hasDolphins

import com.artemis.utils.IntBag; //导入方法依赖的package包/类
private boolean hasDolphins() {
    IntBag dudes = getDudes();

    int[] ids = dudes.getData();
    for (int i = 0, s = dudes.size(); s > i; i++) {
        E e = E.E(ids[i]);
        if (e.hasDolphinized()) return true;
    }
    return false;
}
 
开发者ID:DaanVanYperen,项目名称:odb-little-fortune-planet,代码行数:11,代码来源:AchievementSystem.java

示例12: hasNonDolphins

import com.artemis.utils.IntBag; //导入方法依赖的package包/类
private boolean hasNonDolphins() {
    IntBag dudes = getDudes();

    int[] ids = dudes.getData();
    for (int i = 0, s = dudes.size(); s > i; i++) {
        E e = E.E(ids[i]);
        if (!e.hasDolphinized()) return true;
    }
    return false;
}
 
开发者ID:DaanVanYperen,项目名称:odb-little-fortune-planet,代码行数:11,代码来源:AchievementSystem.java

示例13: deleteInhabitants

import com.artemis.utils.IntBag; //导入方法依赖的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

示例14: reset

import com.artemis.utils.IntBag; //导入方法依赖的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

示例15: timeoutEffects

import com.artemis.utils.IntBag; //导入方法依赖的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


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