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 got
    static void buyItem​(PropItemConfig item)
    The func is used to buy some item
    static PropStoreRecord.BoughtProps getBoughtProps()
    The func is used to get the BoughtProps
    static int getGold()
    The func is used to get the goldCoin got from the goldRecord.json file
    static boolean hasEnoughGold​(int amount)
    The func is used to check if there is enough goldCoin amount
    static boolean isItemBought​(PropItemConfig item)
    The func is used to check if the item is bought
    static void removeItem​(PropItemConfig item)
    The func is used to remove the Item
    static void setBoughtProps​(PropStoreRecord.BoughtProps boughtProps)
    The func is used to set the BoughtProps
    static void setGold​(int gold)
    The func is used to set the goldCoin amount
    static void subtractGold​(int amount)
    The func is used to subtract goldCoin amount got

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • 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

      public static void buyItem​(PropItemConfig item)
      The func is used to buy some item
      Parameters:
      item - the item could be purchased
    • isItemBought

      public static boolean isItemBought​(PropItemConfig item)
      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

      public static void removeItem​(PropItemConfig item)
      The func is used to remove the Item
      Parameters:
      item - the item purchased
    • getBoughtProps

      public static PropStoreRecord.BoughtProps getBoughtProps()
      The func is used to get the BoughtProps
      Returns:
      The BoughtProps
    • setBoughtProps

      public static void setBoughtProps​(PropStoreRecord.BoughtProps boughtProps)
      The func is used to set the BoughtProps
      Parameters:
      boughtProps - the BoughtProps