[Initial Import
Ben.Lippmeier@anu.edu.au**20080201055838] {
adddir ./bin
adddir ./doc
adddir ./log
adddir ./src
adddir ./src/Game
adddir ./src/Util
adddir ./src/Verb
addfile ./Makefile
hunk ./Makefile 1
+
+all :
+ @echo "* Building AAdvent"
+ @ghc -fglasgow-exts -isrc --make src/Main.hs -o bin/aadvent
+
+
+# -- clean
+.PHONY : clean
+clean :
+ @echo "* Cleaning up"
+
+ @rm -f make/Makefile.deps \
+ bin/*
+
+ @find src \
+ -name "*.o" \
+ -o -name "*.hi" \
+ -follow | xargs -n 1 rm -f
+
+ @echo
+
+
+
+# -- build documents
+srcHs = $(shell find src -name "*.hs" -follow)
+
+.PHONY : doc
+doc : $(srcHs)
+ @echo "* Building documentation"
+ @haddock -h -o doc --ignore-all-exports $^
+
addfile ./README
hunk ./README 1
+An Augmented Adventure v1.0
+ maintainer: Ben.Lippmeier@anu.edu.au (Ben Lippmeier)
+
+Written for the COMP1100 course at the
+ Department of Computer Science, Australian National University.
+
+A text adventure, similar to zork. Designed to be easy to extend.
+
addfile ./doc/Format.html
hunk ./doc/Format.html 1
+
+
+
|
|
|
|
|
Description |
Contains the user interaction loop.
+ |
|
Synopsis |
|
|
|
Documentation |
|
initWorld :: World |
The initial state of the world.
+ |
|
banner :: String |
This banner is displayed when the program starts up.
+ |
|
main :: IO () |
Program entry point.
+ |
|
getPlayerInput :: World -> IO World |
Get commands from the user and use them to change the world.
+ |
|
handleInput :: World -> String -> IO World |
Handles a player command.
+ The player may not perform any actions whilst dead.
+ All commands have the form: <verb> [args..]
+ |
|
command :: Verb -> [String] -> World -> IO World |
Use the verb to decide what function to call to handle the command.
+ |
|
Produced by Haddock version 0.7 |
addfile ./doc/Util-Item.html
hunk ./doc/Util-Item.html 1
+
+
+ |
|
|
|
|
Description |
Utils for Mobiles.
+ |
|
Synopsis |
|
|
|
Documentation |
|
isMob :: MobId -> Object -> Bool |
Checks if some object is a Mobile with a specific MobileId.
+ |
|
mobSetLocation :: RoomId -> Object -> Object |
Sets the location of a mobile.
+ |
|
mobAddItem :: ItemId -> Object -> Object |
Adds an item to a mobiles inventory.
+ |
|
mobRemoveItem :: ItemId -> Object -> Object |
Removes an item from a mobiles inventory.
+ |
|
mobLocation :: Object -> RoomId |
Get the location of a mobile.
+ |
|
mobInventory :: Object -> [ItemId] |
Get the inventory of a mobile.
+ |
|
Produced by Haddock version 0.7 |
addfile ./doc/Util-Property.html
hunk ./doc/Util-Property.html 1
+
+
+ |
|
|
|
|
|
Synopsis |
|
|
|
Documentation |
|
worldPlayer :: World -> Object |
Get the player object from the world.
+ |
|
worldPlayerRoom :: World -> Object |
Determine what room the player is in and get that object from the world.
+ |
|
worldPlayerLocation :: World -> RoomId |
Return the RoomId of the room that the player is currently in.
+ |
|
getObject :: (Object -> Bool) -> World -> Object |
Use a predicate to get some object from the world.
+ |
|
modifyObject |
:: (Object -> Bool) | A predicate determining which objects to modify.
+ | -> (Object -> Object) | The modification function.
+ | -> World | | -> World | | Modify some objects in the world.
+ |
|
|
Produced by Haddock version 0.7 |
addfile ./doc/Util.html
hunk ./doc/Util.html 1
+
+
+ |
|
|
|
|
Description |
Defines the main types for the game.
+ |
|
Synopsis |
|
|
|
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 | | Instances | |
|
|
data MobId |
ID codes for Mobiles.
+ | Constructors | | Instances | |
|
|
data RoomId |
Each room in the world has an associated RoomId.
+ | Constructors | Living | | Bedroom | | Kitchen | | Basement | | Porch | | Path | |
| Instances | |
|
|
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 | | Instances | |
|
|
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 | |
| Instances | |
|
|
data ItemId |
Each item in the world has an associated ItemId.
+ | Constructors | ItemUnknown String | | PocketLint | | KeyFrontDoor | | Rope | | Knife | | Amulet | |
| Instances | |
|
|
data PropId |
Each property in the world has an associated PropId.
+ | Constructors | PlayerIsAlive | | FrontDoorUnlocked | | FrontDoorKeyRevealed | |
| Instances | |
|
|
data Prop |
Possible properties.
+ | Constructors | | Instances | |
|
|
Produced by Haddock version 0.7 |
addfile ./doc/doc-index-A.html
hunk ./doc/doc-index-A.html 1
+
+
+