Class PortalAction

java.lang.Object
edu.ntnu.idi.idatt.model.tile.PortalAction
All Implemented Interfaces:
TileAction

public class PortalAction extends Object implements TileAction
PortalAction class

This class represents a Portal action, which is a tile action that moves the player to a random tile. It contains a destination tile ID and a description.

  • Constructor Details

    • PortalAction

      public PortalAction(String identifier, int destinationTileId, String description)
      Constructor for PortalAction class.
      Parameters:
      identifier - The identifier of the action.
      destinationTileId - The ID of the destination tile.
      description - The description of the action.
  • Method Details

    • getIdentifier

      public String getIdentifier()
      Returns the identifier of the action.
      Specified by:
      getIdentifier in interface TileAction
      Returns:
      The identifier of the action.
    • getDestinationTileId

      public int getDestinationTileId()
      Returns the destination tile ID.
      Specified by:
      getDestinationTileId in interface TileAction
      Returns:
      The destination tile ID.
    • getDescription

      public String getDescription()
      Returns the description of the action.
      Specified by:
      getDescription in interface TileAction
      Returns:
      The description of the action.
    • setIdentifier

      public void setIdentifier(String identifier)
      Sets the identifier of the action.
      Specified by:
      setIdentifier in interface TileAction
      Parameters:
      identifier - The identifier to set.
    • setDestinationTileId

      public void setDestinationTileId(int destinationTileId)
      Sets the destination tile ID.
      Specified by:
      setDestinationTileId in interface TileAction
      Parameters:
      destinationTileId - The destination tile ID to set.
    • setDescription

      public void setDescription(String description)
      Sets the description of the action.
      Specified by:
      setDescription in interface TileAction
      Parameters:
      description - The description to set.
    • perform

      public void perform(Player player, Board board)
      Performs the action on the given player and board.
      Specified by:
      perform in interface TileAction
      Parameters:
      player - The player to perform the action on.
      board - The board to perform the action on.