Package com.bdtripp.hauntedhouse.model
Class World
java.lang.Object
com.bdtripp.hauntedhouse.model.World
Represents the complete game world.
Stores the player, all rooms, and the starting location.
- Author:
- Brian Tripp
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
World
Create the game world that has a player, rooms, a starting room, key etc.- Parameters:
player- the player of the gamerooms- the rooms in the gamestartingRoom- the room where the game startskey- a key that unlocks an exit
-
-
Method Details
-
getPlayer
Returns the player associated with this world.- Returns:
- the player of the game world
-
getRooms
Returns all rooms that exist in the game world.- Returns:
- the rooms in the game
-
getStartingRoom
Returns the room where the player begins the game.- Returns:
- the starting room of the game
-
getRoom
Get the room that matches a name- Parameters:
name- the name of the room- Returns:
- the room
-
getKey
Returns the key used to unlock a specific exit in the world.- Returns:
- the key
-