Class TowerUpgraderComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.tower.TowerUpgraderComponent

public class TowerUpgraderComponent extends Component
Listens for an event from the popup menu to upgrade the turret entity this component is attached to.
  • 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.
      Overrides:
      create in class Component
    • upgradeTower

      public void upgradeTower(TowerUpgraderComponent.UPGRADE upgradeType, int value)
      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 do
      value - 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.