Package com.csse3200.game.currency
Class Currency
java.lang.Object
com.csse3200.game.currency.Currency
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
Currency
Constructor for the currency object.- Parameters:
logoFilePath
- the file path of the logo
-
-
Method Details
-
getName
-
getAmount
public int getAmount() -
setAmount
public void setAmount(int amount) -
getTexture
Getter for the logo of the currency.- Returns:
- the logo of the currency in a Texture format.
-
modify
public void modify(int addedAmount) This method increments the currency amount by a given amount. Added amount is assumed to be larger than negative the currency's amount.- Parameters:
addedAmount
- The amount the currency will be incremented by.- Requires:
- addedAmount >= -this.amount
-
canBuy
public boolean canBuy(int cost) Checks if you can buy some item with a given cost.- Parameters:
cost
- the cost of the item.- Returns:
- boolean representing if you can buy that object or not.
-
toString
-