Package org.progettoedids.rooms
Class VictoryRoom
java.lang.Object
org.progettoedids.rooms.Room
org.progettoedids.rooms.VictoryRoom
- All Implemented Interfaces:
InteractiveOnTurnStart
A subtype of Room that is always unlocked and that makes the Player win the game when it gets into it.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinteractOnTurnStart(CommandLogger commandLogger, Labyrinth labyrinth) Interacts with the user and send an exception to Game that the game was won.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
-
VictoryRoom
public VictoryRoom()
-
-
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
public void interactOnTurnStart(CommandLogger commandLogger, Labyrinth labyrinth) throws VictoryException Interacts with the user and send an exception to Game that the game was won.- 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- Throws:
VictoryException- to indicate that the Game was won
-