Class ShopUIFunctionalityComponent

java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.building.ShopUIFunctionalityComponent

public class ShopUIFunctionalityComponent extends Component
Adds shop spending and trading functionality.
  • Constructor Details

    • ShopUIFunctionalityComponent

      public ShopUIFunctionalityComponent()
  • Method Details

    • create

      public void create()
      Description copied from class: Component
      Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished.
      Overrides:
      create in class Component
    • onUnitUpgrade

      public void onUnitUpgrade()
      Upgrades soldier units.
    • localRemove

      public void localRemove()
    • removeButton

      public static void removeButton()
      Removes the shop UI
    • spendResources

      public static boolean spendResources(int wood, int metal, int stone)
      Spends resources through the shop UI
      Parameters:
      wood - amount of wood item costs
      metal - amount of metal item costs
      stone - amount of stone item costs
      Returns:
      true if player has enough to buy item, else false
    • onWallUpgrade

      public void onWallUpgrade()
      Upgrades all game walls.
    • onUnitSpawn

      public void onUnitSpawn()
      Spawns units in the city centre.