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 InventoryImprovementsprivate int -
Constructor Summary
ConstructorsConstructorDescriptionConstructorConstructorInventory(Map<TileColor, InventoryBambooStack> bambooStacks) ConstructorInventory(Map<TileColor, InventoryBambooStack> bambooStacks, InventoryImprovements inventoryImprovements) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()reset inventoryvoidcollectBamboo(TileColor tileColor) add 1 bamboo to the inventoryvoidcopy()booleanintintgetBambooCount(TileColor tileColor) Return the number of bamboo of a specific colorgetBambooStack(TileColor tileColor) intgetImprovementCount(ImprovementType improvementType) intinthashCode()booleanMethod to verify whether the inventory contains any improvement or notbooleanhasImprovement(ImprovementType improvementType) Method to verify whether the inventory contains the improvement type specified or notvoidstoreImprovement(ImprovementType improvementType) toString()voidRemove bamboo from the player's inventory when an objective is redeemedvoiduseImprovement(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
-