Package model

Class Barracks

All Implemented Interfaces:
Serializable

public class Barracks extends Building
Implementation of Barracks Building type.
See Also:
  • Constructor Details

    • Barracks

      public Barracks(Point position, Sides side)
      Constructs a new Barracks instance.
      Parameters:
      position - the barrack's position on the Map
      side - the side it belongs to
    • Barracks

      public Barracks(Point position)
      Constructs a new Barracks instance.
      Parameters:
      position - the barrack's position on the Map
  • Method Details

    • isUpgraded

      public boolean isUpgraded()
      Returns if the Barrack instance is upgraded.
      Returns:
      if the Barrack instance is upgraded
    • setUpgraded

      public void setUpgraded(boolean isUpgraded)
      Sets if the Barrack instance is upgraded.
      Parameters:
      isUpgraded - if the Barrack instance is upgraded
    • upgrade

      public void upgrade()
      Upgrades the Barrack instance.
      Specified by:
      upgrade in class Building
    • getUpgradeCost

      public int getUpgradeCost()
      Returns the upgrade cost of the Barrack instance.
      Specified by:
      getUpgradeCost in class Building
      Returns:
      the upgrade cost of the Barrack instance