Package org.progettoedids.rooms
Class TeleportRoom
java.lang.Object
org.progettoedids.rooms.Room
org.progettoedids.rooms.TeleportRoom
- All Implemented Interfaces:
InteractiveOnTurnStart
A subtype of Room that is always unlocked and that teleports the Player that comes into it in another Room.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinteractOnTurnStart(CommandLogger commandLogger, Labyrinth labyrinth) Teleports the Player to another Room reachable from the Teleport room.booleanisLocked()Returns whether the Room is locked or not.Methods inherited from class org.progettoedids.rooms.Room
addEntity, getCharSymbol, getEntities, getEntities, getEntity, removeEntity
-
Field Details
-
CHAR_SYMBOL
public static final char CHAR_SYMBOL- See Also:
-
-
Constructor Details
-
TeleportRoom
public TeleportRoom()
-
-
Method Details
-
isLocked
public boolean isLocked()Description copied from class:RoomReturns whether the Room is locked or not.A locked Room cannot be crossed by other Entity(ies). Depending on subtype implementation it might be possible the Room can be unlocked in some way.
-
interactOnTurnStart
Teleports the Player to another Room reachable from the Teleport room.Note that the Teleport room itself is a candidate for the destination of the teleport.
- Specified by:
interactOnTurnStartin interfaceInteractiveOnTurnStart- Parameters:
commandLogger- the CommandLogger onto which the user typed commands are saved. Must not be nulllabyrinth- the Labyrinth on which the interaction actions are performed. Must not be null
-