o1.adventure.draft
Type members
Classlikes
The class Action
represents actions that a player may take in a text adventure game.
Action
objects are constructed on the basis of textual commands and are, in effect,
parsers for such commands. An action object is immutable after creation.
The class Action
represents actions that a player may take in a text adventure game.
Action
objects are constructed on the basis of textual commands and are, in effect,
parsers for such commands. An action object is immutable after creation.
- Value parameters:
- input
a textual in-game command such as “go east” or “rest”
The class Adventure
represents text adventure games. An adventure consists of a player and
a number of areas that make up the game world. It provides methods for playing the game one
turn at a time and for checking the state of the game.
The class Adventure
represents text adventure games. An adventure consists of a player and
a number of areas that make up the game world. It provides methods for playing the game one
turn at a time and for checking the state of the game.
NOTE: The AdventureDraft module is not even close to being well designed. See Chapter 9.3 in the course materials.
The class Area
represents locations in a text adventure game world. A game world
consists of areas. In general, an “area” can be pretty much anything: a room, a building,
an acre of forest, or something completely different. What different areas have in
common is that players can be located in them and that areas can have exits leading to
other, neighboring areas. An area also has a name and a description.
The class Area
represents locations in a text adventure game world. A game world
consists of areas. In general, an “area” can be pretty much anything: a room, a building,
an acre of forest, or something completely different. What different areas have in
common is that players can be located in them and that areas can have exits leading to
other, neighboring areas. An area also has a name and a description.
NOTE: The AdventureDraft module is not even close to being well designed. See Chapter 9.3 in the course materials.
- Value parameters:
- description
a description of the area
- name
the name of the area
A Player
object represents a player character controlled by the real-life
user of the program.
A Player
object represents a player character controlled by the real-life
user of the program.
A player object’s state is mutable: the player’s location and possessions can change, for instance.
NOTE: The AdventureDraft module is not even close to being well designed. See Chapter 9.3 in the course materials.
- Value parameters:
- startingArea
the player’s initial location