Class ShopUIFunctionalityComponent
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.building.ShopUIFunctionalityComponent
Adds shop spending and trading functionality.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate()Called when the entity is created and registered.voidvoidSpawns units in the city centre.voidUpgrades soldier units.voidUpgrades all game walls.static voidRemoves the shop UIstatic booleanspendResources(int wood, int metal, int stone) Spends resources through the shop UIMethods inherited from class com.deco2800.game.components.Component
dispose, earlyUpdate, getEntity, isAnimationRenderComponent, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
ShopUIFunctionalityComponent
public ShopUIFunctionalityComponent()
-
-
Method Details
-
create
public void create()Description copied from class:ComponentCalled 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. -
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 costsmetal- amount of metal item costsstone- 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.
-