當前位置: 首頁>>代碼示例>>Java>>正文


Java IntMap.values方法代碼示例

本文整理匯總了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();
}
 
開發者ID:guillaume-alvarez,項目名稱:ShapeOfThingsThatWere,代碼行數:18,代碼來源:DiscoverySystem.java

示例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;
}
 
開發者ID:mganzarcik,項目名稱:fabulae,代碼行數:23,代碼來源:Inventory.java

示例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;
}
 
開發者ID:mganzarcik,項目名稱:fabulae,代碼行數:18,代碼來源:Inventory.java

示例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;
}
 
開發者ID:mganzarcik,項目名稱:fabulae,代碼行數:15,代碼來源:Inventory.java

示例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);
		}
	}
}
 
開發者ID:mganzarcik,項目名稱:fabulae,代碼行數:9,代碼來源:Inventory.java

示例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();
		}
	}
}
 
開發者ID:mganzarcik,項目名稱:fabulae,代碼行數:9,代碼來源:Inventory.java

示例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;
        }
    }

}
 
開發者ID:Rubentxu,項目名稱:GDX-Logic-Bricks,代碼行數:10,代碼來源:EntityBuilder.java


注:本文中的com.badlogic.gdx.utils.IntMap.values方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。