Class BuildingActions

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

public class BuildingActions extends Component
Action component for interacting with a building. Building events should be initialised in create() and when triggered should call methods within this class.
  • Constructor Details

    • BuildingActions

      public BuildingActions(Building type, int level)
      Constructs components with specified level
      Parameters:
      level - initial building level when created
      type - type of Building
  • Method Details

    • getLevel

      public int getLevel()
      Returns:
      Building level
    • getType

      public Building getType()
      Returns:
      Building type
    • addLevel

      public void addLevel()
      Increments level by 1 and upgrades combat stats
    • incrementLevel

      public void incrementLevel()
      Increases level by 1
    • isWall

      public static boolean isWall(Building type)
      Used for determining if an entity is a wall
      Parameters:
      type - Building type
      Returns:
      If the building is a wall -> true; else -> false
    • setWallDefault

      public void setWallDefault()
      Sets wall type and texture to default (facing in no particular direction)
    • setWallNE

      public void setWallNE()
      Sets wall type and texture to north-east facing wall
    • setWallSE

      public void setWallSE()
      Sets wall type and texture to south-east facing wall
    • create

      public void create()
      Called upon creation. Used to define events for event listener to trigger.
      Overrides:
      create in class Component