Package com.takenoko.inventory
Class Inventory
java.lang.Object
com.takenoko.inventory.Inventory
Inventory contains elements stored by player
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<TileColor,
InventoryBambooStack> private final InventoryImprovements
private int
-
Constructor Summary
ConstructorsConstructorDescriptionConstructorConstructorInventory
(Map<TileColor, InventoryBambooStack> bambooStacks) ConstructorInventory
(Map<TileColor, InventoryBambooStack> bambooStacks, InventoryImprovements inventoryImprovements) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
reset inventoryvoid
collectBamboo
(TileColor tileColor) add 1 bamboo to the inventoryvoid
copy()
boolean
int
int
getBambooCount
(TileColor tileColor) Return the number of bamboo of a specific colorgetBambooStack
(TileColor tileColor) int
getImprovementCount
(ImprovementType improvementType) int
int
hashCode()
boolean
Method to verify whether the inventory contains any improvement or notboolean
hasImprovement
(ImprovementType improvementType) Method to verify whether the inventory contains the improvement type specified or notvoid
storeImprovement
(ImprovementType improvementType) toString()
void
Remove bamboo from the player's inventory when an objective is redeemedvoid
useImprovement
(ImprovementType improvementType) void
-
Field Details
-
bambooStacks
-
inventoryImprovements
-
irrigationChannelsCount
private int irrigationChannelsCount
-
-
Constructor Details
-
Inventory
public Inventory(Map<TileColor, InventoryBambooStack> bambooStacks, InventoryImprovements inventoryImprovements) Constructor- Parameters:
bambooStacks
- bamboo stacksinventoryImprovements
- improvements
-
Inventory
Constructor- Parameters:
bambooStacks
- bamboo stacks
-
Inventory
public Inventory()Constructor -
Inventory
Constructor- Parameters:
inventory
- inventory
-
-
Method Details
-
collectBamboo
add 1 bamboo to the inventory -
storeImprovement
- Parameters:
improvementType
- store an improvement in order to use it later on
-
useImprovement
- Parameters:
improvementType
- use improvement previously stored
-
getBambooCount
public int getBambooCount()- Returns:
- number of bamboos in Inventory
-
getBambooCount
Return the number of bamboo of a specific color- Parameters:
tileColor
- color of bamboo- Returns:
- number of bamboos in Inventory
-
getBambooStack
- Returns:
- the bambooStack
-
getInventoryImprovements
- Returns:
- the list of stored improvements
-
collectIrrigationChannel
public void collectIrrigationChannel() -
getIrrigationChannelsCount
public int getIrrigationChannelsCount() -
useIrrigationChannel
public void useIrrigationChannel() -
clear
public void clear()reset inventory -
copy
-
equals
-
hashCode
public int hashCode() -
hasImprovement
Method to verify whether the inventory contains the improvement type specified or not- Parameters:
improvementType
- improvement type
-
hasImprovement
public boolean hasImprovement()Method to verify whether the inventory contains any improvement or not- Returns:
- true if the inventory contains any improvement, false otherwise
-
useBamboo
Remove bamboo from the player's inventory when an objective is redeemed- Parameters:
bambooTarget
- how many bamboo to use
-
toString
-
getImprovementCount
-