当前位置: 首页>>代码示例>>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;未经允许,请勿转载。