o1.adventure.draft
Members list
Packages
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.
Parameters
- input
-
a textual in-game command such as “go east” or “rest”
Attributes
- Supertypes
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.
Attributes
- Supertypes
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.
Parameters
- description
-
a description of the area
- name
-
the name of the area
Attributes
- Supertypes
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.
Parameters
- startingArea
-
the player’s initial location
Attributes
- Supertypes