Package com.deco2800.game.files
Class PropStoreRecord
java.lang.Object
com.deco2800.game.files.PropStoreRecord
public class PropStoreRecord
extends java.lang.Object
This class is used to record the goldCoin that will be used from the prop store
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PropStoreRecord.BoughtProps
static class
PropStoreRecord.Gold
-
Constructor Summary
Constructors Constructor Description PropStoreRecord()
-
Method Summary
Modifier and Type Method Description static void
addGold(int amount)
The func is used to add goldCoin amount gotstatic void
buyItem(PropItemConfig item)
The func is used to buy some itemstatic PropStoreRecord.BoughtProps
getBoughtProps()
The func is used to get the BoughtPropsstatic int
getGold()
The func is used to get the goldCoin got from the goldRecord.json filestatic boolean
hasEnoughGold(int amount)
The func is used to check if there is enough goldCoin amountstatic boolean
isItemBought(PropItemConfig item)
The func is used to check if the item is boughtstatic void
removeItem(PropItemConfig item)
The func is used to remove the Itemstatic void
setBoughtProps(PropStoreRecord.BoughtProps boughtProps)
The func is used to set the BoughtPropsstatic void
setGold(int gold)
The func is used to set the goldCoin amountstatic void
subtractGold(int amount)
The func is used to subtract goldCoin amount got
-
Constructor Details
-
PropStoreRecord
public PropStoreRecord()
-
-
Method Details
-
getGold
public static int getGold()The func is used to get the goldCoin got from the goldRecord.json file- Returns:
- gold got
-
setGold
public static void setGold(int gold)The func is used to set the goldCoin amount- Parameters:
gold
- goldCoin amount
-
subtractGold
public static void subtractGold(int amount)The func is used to subtract goldCoin amount got- Parameters:
amount
- goldCoin amount
-
addGold
public static void addGold(int amount)The func is used to add goldCoin amount got- Parameters:
amount
- goldCoin amount
-
hasEnoughGold
public static boolean hasEnoughGold(int amount)The func is used to check if there is enough goldCoin amount- Parameters:
amount
- goldCoin amount- Returns:
- true, enough gold got false, not enough
-
buyItem
The func is used to buy some item- Parameters:
item
- the item could be purchased
-
isItemBought
The func is used to check if the item is bought- Parameters:
item
- the item purchased- Returns:
- true, the item has been purchased false, not be purchased
-
removeItem
The func is used to remove the Item- Parameters:
item
- the item purchased
-
getBoughtProps
The func is used to get the BoughtProps- Returns:
- The BoughtProps
-
setBoughtProps
The func is used to set the BoughtProps- Parameters:
boughtProps
- the BoughtProps
-