Package org.progettoedids.rooms
Class RoomWithDoors
java.lang.Object
org.progettoedids.rooms.Room
org.progettoedids.rooms.RoomWithDoors
- All Implemented Interfaces:
UnlockableRoom
A subtype of Room that is locked at creation time until it's unlocked with a Key.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
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
-
RoomWithDoors
public RoomWithDoors()
-
-
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.
-
unlock
Unlocks the RoomWithDoors if a Key is provided.- Parameters:
key- a Key. Must not be null
-
unlock
- Specified by:
unlockin interfaceUnlockableRoom
-