ContentsIndex
World
Description
Defines the main types for the game.
Synopsis
type Name = String
type Script = String
type Inventory = [ItemId]
type Detail = (String, String)
type World = [Object]
data Object
= Mob MobId Name RoomId Inventory
| Room RoomId Name Script [Detail] [(Direction, Exit)] Inventory
| Item ItemId Name Script
| Property PropId Prop
data MobId = Player
data RoomId
= Living
| Bedroom
| Kitchen
| Basement
| Porch
| Path
data Exit
= Exit RoomId
| Door RoomId PropId String
data Direction
= North
| South
| East
| West
| Down
| Up
| Direct String
data ItemId
= ItemUnknown String
| PocketLint
| KeyFrontDoor
| Rope
| Knife
| Amulet
data PropId
= PlayerIsAlive
| FrontDoorUnlocked
| FrontDoorKeyRevealed
data Prop = PropBool Bool
Documentation
type Name = String
The name of something.
type Script = String
A description of something.
type Inventory = [ItemId]
An inventory, carried by some Mobile.
type Detail = (String, String)
A detail of a room.
type World = [Object]
The world is a list of all the objects in the game.
data Object
An object in the game world.
Constructors
Mob MobId Name RoomId InventoryA mobile. Mobiles are players or other creatures which can carry items and move between rooms.
Room RoomId Name Script [Detail] [(Direction, Exit)] InventoryA room in the world.
Item ItemId Name ScriptAn item in the world.
Property PropId PropSome property of the world.
show/hide Instances
Eq Object
Show Object
data MobId
ID codes for Mobiles.
Constructors
Player
show/hide Instances
Eq MobId
Show MobId
data RoomId
Each room in the world has an associated RoomId.
Constructors
Living
Bedroom
Kitchen
Basement
Porch
Path
show/hide Instances
Eq RoomId
Show RoomId
data Exit
An exit can either be freely passable, or have a door in it. If it is a Door then the associated property in the World must have the value (PropBool True) for the player to pass. If the player tries to pass through a door which is closed, the associated bump bump string is printed.
Constructors
Exit RoomId
Door RoomId PropId String
show/hide Instances
Eq Exit
Show Exit
data Direction
An exit direction. (Direct String) can be used to represent a special named direction, ie not (n,s,e,w,u,d).
Constructors
North
South
East
West
Down
Up
Direct String
show/hide Instances
data ItemId
Each item in the world has an associated ItemId.
Constructors
ItemUnknown String
PocketLint
KeyFrontDoor
Rope
Knife
Amulet
show/hide Instances
Eq ItemId
Show ItemId
data PropId
Each property in the world has an associated PropId.
Constructors
PlayerIsAlive
FrontDoorUnlocked
FrontDoorKeyRevealed
show/hide Instances
Eq PropId
Show PropId
data Prop
Possible properties.
Constructors
PropBool Bool
show/hide Instances
Eq Prop
Show Prop
Produced by Haddock version 0.7