本文整理匯總了Java中com.badlogic.gdx.utils.IntMap.values方法的典型用法代碼示例。如果您正苦於以下問題:Java IntMap.values方法的具體用法?Java IntMap.values怎麽用?Java IntMap.values使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.utils.IntMap
的用法示例。
在下文中一共展示了IntMap.values方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getNeighbors
import com.badlogic.gdx.utils.IntMap; //導入方法依賴的package包/類
private Iterable<Entity> getNeighbors(Entity empire) {
IntMap<Entity> neighbors = new IntMap<>();
// collect entities we have relations with
for (Entity e : relations.get(empire).relations.keySet())
neighbors.put(e.getId(), e);
// collect entities we share influence with
for (MapPosition p : influences.get(empire).influencedTiles)
for (Entry inf : map.getInfluenceAt(p))
if (inf.key != empire.getId() && !neighbors.containsKey(inf.key)
// may be pending insertion into world if just revolted
&& world.getEntityManager().isActive(inf.key))
neighbors.put(inf.key, world.getEntity(inf.key));
return neighbors.values();
}
示例2: getItem
import com.badlogic.gdx.utils.IntMap; //導入方法依賴的package包/類
/**
* Returns the item with the specified id from this Inventory, or null if
* such item cannot be found.
*
* The item is not actually removed from the intenvory when returned!
*
* @param id
* @return
*/
public InventoryItem getItem(String id) {
id = id.toLowerCase(Locale.ENGLISH);
for (BagType bagType : BagType.values()) {
IntMap<InventoryItem> bag = bags.get(bagType);
for (InventoryItem item : bag.values()) {
if (id.equals(item.getId())) {
return item;
}
}
}
return null;
}
示例3: getTotalTradingCost
import com.badlogic.gdx.utils.IntMap; //導入方法依賴的package包/類
/**
* Returns the total value of all items in the supplied bag
* for trading purposes.
*
* @param bag
* @return
* @see InventoryItem#getTradingCost(GameCharacter, GameCharacter, boolean)
*/
public int getTotalTradingCost(BagType bag, GameCharacter customer, GameCharacter trader,
boolean buying) {
int returnValue = 0;
IntMap<InventoryItem> items = bags.get(bag);
for (InventoryItem item : items.values()) {
returnValue += item.getTradingCost(customer, trader, buying);
}
return returnValue;
}
示例4: getAllItems
import com.badlogic.gdx.utils.IntMap; //導入方法依賴的package包/類
/**
* Returns an array of all items in all of the bags in the inventory.
*
* @return
*/
public Array<InventoryItem> getAllItems() {
Array<InventoryItem> returnValue = new Array<InventoryItem>();
for (IntMap<InventoryItem> bag : bags.values()) {
for (InventoryItem item : bag.values()) {
returnValue.add(item);
}
}
return returnValue;
}
示例5: gatherAssets
import com.badlogic.gdx.utils.IntMap; //導入方法依賴的package包/類
@Override
public void gatherAssets(AssetMap assetStore) {
for (IntMap<InventoryItem> bag : bags.values()) {
for (InventoryItem item : bag.values()) {
item.gatherAssets(assetStore);
}
}
}
示例6: clearAssetReferences
import com.badlogic.gdx.utils.IntMap; //導入方法依賴的package包/類
@Override
public void clearAssetReferences() {
for (IntMap<InventoryItem> bag : bags.values()) {
for (InventoryItem item : bag.values()) {
item.clearAssetReferences();
}
}
}
示例7: config
import com.badlogic.gdx.utils.IntMap; //導入方法依賴的package包/類
private void config(IntMap<ObjectSet<LogicBrick>> bricks, Entity entity) {
if (entity == null) throw new LogicBricksException(tag, "Error: Not owner entity exist");
for (ObjectSet<LogicBrick> bricksSet : bricks.values()) {
for (LogicBrick brick : bricksSet) {
brick.owner = entity;
}
}
}