Class TileStorageComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.tile.TileStorageComponent

public class TileStorageComponent extends Component
A component that is used to track the status of the unit placed on a tile, it is also used for adding and removing the units from the tile.
  • Constructor Details

    • TileStorageComponent

      public TileStorageComponent(AreaAPI area)
  • Method Details

    • setTileUnit

      public boolean setTileUnit(Entity unit)
      Sets the unit of a tile
      Parameters:
      unit - the unit being added to the tile
    • getTileUnit

      public Entity getTileUnit()
      Gets the unit that a tile stores
      Returns:
      the unit of a tile
    • removeTileUnit

      public void removeTileUnit()
      Removes the unit from the tile
    • hasUnit

      public boolean hasUnit()
      Checks if a unit is being stored by this tile
      Returns:
      a boolean value for if the tile has a unit
    • getPosition

      public int getPosition()
      Gets the position of the tile
      Returns:
      the tile's position
    • setPosition

      public void setPosition(int position)
      Sets the position of the tile
      Parameters:
      position - the position for the tile to be set at
    • getArea

      public AreaAPI getArea()