Class TowerUpgraderComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.tower.TowerUpgraderComponent
Listens for an event from the popup menu to upgrade
the turret entity this component is attached to.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Called when the entity is created and registered.void
Restores the tower's health to its maximum health.void
upgradeTower
(TowerUpgraderComponent.UPGRADE upgradeType, int value) Determines which type of upgrade to perform based on arguments provided by the event trigger.Methods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
TowerUpgraderComponent
public TowerUpgraderComponent()
-
-
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. -
upgradeTower
Determines which type of upgrade to perform based on arguments provided by the event trigger. Note: The fire rate upgrade is in shots per minute.- Parameters:
upgradeType
- An enum indicating the type of upgrade to dovalue
- How much the upgrade should change the tower's stats, if applicable
-
repairTower
public void repairTower()Restores the tower's health to its maximum health.
-