Code example for Map.Entry

Methods: getKey, getValue

0
 
	public boolean requirementsMet(Player p) {
		Iterator<Entry<InventoryObject, Integer>> it = currentLevel.getRequirements().entrySet().iterator();
		while(it.hasNext()) {
			Map.Entry pairs = (Map.Entry)it.next();
			if (p.getInventory().contains((InventoryObject) pairs.getKey()) < (Integer)pairs.getValue()) return false;
		} 
		return true; 
	} 
}