Players find themselves trapped in a house and have to collect and use items in order to find a way out.
Hilary Schulz

## Setup
Clone source code to your machine on your terminal.
Run:
mvn clean install
To Play Game:
mvn exec:java
## How to Play This game is a terminal application and is completely text-based. Players move around, inspect objects and collect items by typing commands into the terminal.
- describe wall
- enter [PORTAL]
- inspect [ELEMENT]
- save
- take [ITEM]
- turn [LEFT, RIGHT, AROUND]
- use [ITEM]
- view inventory
- quit
User interaction with the terminal. Users type commands directly in the command prompt and visually see the narration of the game.
Handles business logic of the application. Includes item actions and player commands
- EntityUseType.java
- CommandProcessor.java
Handles saving and loading of the game into files.
- GameSaver.java
- GameLoader.java
- HouseData.json
- saveHouse.json
- savePlayer.json
Package that stores all the classes that form the house:
- Rooms
- Walls
- Portals
- Containers
Package that stores all the game logic and the initial creation of the house itself.
The house is built from a JSON file called HouseData.json which holds all the data for each room in the house. HouseBuilder.java reads this file in and serializes the information into a java object which it then returns.
House house = mapper.readValue(new File("resources/HouseData.json"), House.class);Package that stores items and specific actions for each one.
Item actions are handled with Java enums found in EntityUseType.java. Each item has a parameter useType which holds an enum to indicate the item's action.
- keys -> new KeyAction()
- scissors -> new ScissorsAction()
Each action class has a use() method that is specific to that item. This method is called by item's use() method.
Package that stores player commands and their specific actions
Player actions are handled with the Command Pattern. There is a Command interface and multiple Command classes (such as SaveCommand, EnterCommand, etc...) that implement this interface.
Invoker.java sets the current Command action to be run. The function for each specific command is located in CommandProcessor.java
Creates one instance of a house and a player.
- GlobalHouse.java
- GlobalPlayer.java
- All files able to access the current house and player
- Avoids conflicting requests for the same resource
Allows the requester of a particular command to be decoupled from the object that performs the command
- Invoker.java
- Command.java
- CommandProcessor.java
- Extensibility - can add new commands without changing existing code
- Puts all commands in one location
- Item Actions
- Command Pattern with Player Actions
- JSON Serialization
- Outlining/structuring project before implementation
- Importance of testing as you go
- Design patterns can be very effective when used appropriately



