|  | Home · Examples

# Putting it all Together

Finally, we are ready to look at an example that brings what we have learned in this tutorial together. After this example, you can also check out the generator example, which uses the generator on a library for creating graphic adventure games.

## Text Adventure Example

In keeping with the generator example, we will create an adventure game engine in C++ and map that to Java. However, we will venture a little longer back in time - to the eighties to be exact - when the text adventure had its days of glory.

Our text adventure library will contain a command parser, an object tree , and a collection of actions the player can make. The library consists of the following classes:

- Parser The parser knows how to parse the commands the player enteres, and will execute the commands given.
- AdvObject Represents an object in the game, such as the player, a rooom, or a car. The objects are kept in a tree, which represents the world of the game.
- Action An action represents an action the player can make. It contains a set of sentences (commands) the player can write to execute the action.
- World Contains the root of the object tree, the current location of the player, and the objects held by the player.

## Example Java Game

In this section, we take a quick look at a Java game implemented using our text adventure library.

We have