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


Java ObjectSet.remove方法代码示例

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


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

示例1: removeGameObject

import com.badlogic.gdx.utils.ObjectSet; //导入方法依赖的package包/类
/**
 * Removes the supplied GameObject from this map.
 * 
 * The GO will no longer be rendered.
 * 
 * @param go
 */
public void removeGameObject(GameObject go) {
	gameObjects.removeValue(go, false);
	if (go instanceof Drawable) {
		removeDrawable((Drawable)go);
	}
	if (go instanceof TextDrawer) {
		textDrawers.removeValue((TextDrawer)go, false);
	}
	if (go instanceof TileBlocker) {
		blockers.removeValue((TileBlocker)go, false);
	}
	if (gameObjectsByType.containsKey(go.getType())) {
		gameObjectsByType.get(go.getType()).removeValue(go, false);
	}
	if (gameObjectsByClass.containsKey(go.getClass())) {
		gameObjectsByClass.get(go.getClass()).removeValue(go, false);
	}
	if (gameObjectTileMap != null) {
		for (ObjectSet<GameObject> objects : gameObjectTileMap) {
			objects.remove(go);
		}
	}
	
}
 
开发者ID:mganzarcik,项目名称:fabulae,代码行数:32,代码来源:GameMap.java

示例2: getAllCharactersInArea

import com.badlogic.gdx.utils.ObjectSet; //导入方法依赖的package包/类
/**
 * Returns an array of all characters in the supplied area that fulfill the supplied filters requirements.
 * 
 * @param returnValue - the set into which to store the result. Can be null. In that case, only true / false will be returned
 * indicating whether any characters were found
 * @param filters - an array of filters that the characters must fulfill. Can be empty.
 * @return true if any characters were found, false otherwise
 */
private boolean getAllCharactersInArea(ObjectSet<AbstractGameCharacter> returnValue, PositionArray area, CharacterFilter... filters) {
	if (area == null) {
		return false;
	}
	if (returnValue == null) {
		tempSet.clear();
	}
	
	ObjectSet<AbstractGameCharacter> setToUse = returnValue != null ? returnValue : tempSet; 
	
	if (!getMap().getAllObjectsInArea(setToUse, area, AbstractGameCharacter.class)) {
		return false;
	}
	
	setToUse.remove(this);
	
	if (filters.length > 0) {
		Iterator<AbstractGameCharacter> iterator = setToUse.iterator();
		while (iterator.hasNext()) {
			AbstractGameCharacter go = iterator.next();
			for (CharacterFilter filter : filters) {
				if (filter.shouldFilter(this, go)) {
					iterator.remove();
					break;
				}
			}
		}
	}
	
	return setToUse.size > 0;
}
 
开发者ID:mganzarcik,项目名称:fabulae,代码行数:40,代码来源:AbstractGameCharacter.java

示例3: removeScheduledAssets

import com.badlogic.gdx.utils.ObjectSet; //导入方法依赖的package包/类
@Override
public void removeScheduledAssets(final ObjectSet<String> scheduledAssets) {
    for (final String assetPath : assetPaths) {
        scheduledAssets.remove(assetPath);
    }
}
 
开发者ID:gdx-libs,项目名称:gdx-autumn-mvc,代码行数:7,代码来源:ObjectSetAssetInjection.java

示例4: removeScheduledAssets

import com.badlogic.gdx.utils.ObjectSet; //导入方法依赖的package包/类
@Override
public void removeScheduledAssets(final ObjectSet<String> scheduledAssets) {
    scheduledAssets.remove(assetPath);
}
 
开发者ID:gdx-libs,项目名称:gdx-autumn-mvc,代码行数:5,代码来源:StandardAssetInjection.java


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