Package edu.ntnu.idi.idatt.model.tile
Class LadderAction
java.lang.Object
edu.ntnu.idi.idatt.model.tile.LadderAction
- All Implemented Interfaces:
TileAction
LadderAction class
This class represents a ladder action, which is a tile action that moves the player to a different tile. It contains a destination tile ID and a description.
-
Constructor Summary
ConstructorsConstructorDescriptionLadderAction
(String identifier, int destinationTileId, String description) Constructor for LadderAction class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the description of the action.int
Returns the destination tile ID.Returns the identifier of the action.void
Performs the action on the given player and board.void
setDescription
(String description) Sets the description of the action.void
setDestinationTileId
(int destinationTileId) Sets the destination tile ID.void
setIdentifier
(String identifier) Sets the identifier of the action.
-
Constructor Details
-
LadderAction
Constructor for LadderAction class.- Parameters:
identifier
- The identifier of the action.destinationTileId
- The ID of the destination tile.description
- The description of the action.
-
-
Method Details
-
getIdentifier
Returns the identifier of the action.- Specified by:
getIdentifier
in interfaceTileAction
- Returns:
- The identifier of the action.
-
getDestinationTileId
public int getDestinationTileId()Returns the destination tile ID.- Specified by:
getDestinationTileId
in interfaceTileAction
- Returns:
- The destination tile ID.
-
getDescription
Returns the description of the action.- Specified by:
getDescription
in interfaceTileAction
- Returns:
- The description of the action.
-
setIdentifier
Sets the identifier of the action.- Specified by:
setIdentifier
in interfaceTileAction
- Parameters:
identifier
- The identifier to set.
-
setDestinationTileId
public void setDestinationTileId(int destinationTileId) Sets the destination tile ID.- Specified by:
setDestinationTileId
in interfaceTileAction
- Parameters:
destinationTileId
- The destination tile ID to set.
-
setDescription
Sets the description of the action.- Specified by:
setDescription
in interfaceTileAction
- Parameters:
description
- The description to set.
-
perform
Performs the action on the given player and board.- Specified by:
perform
in interfaceTileAction
- Parameters:
player
- The player to perform the action on.board
- The board to perform the action on.
-