#ifndef _WUMPI_H #define _WUMPI_H // Maze class // // Default Constructor --> reads maze data from configuration file caves.dat // to create maze // ******************************************************* // void Toss(int tunnel) --> toss grende (if any) into tunnnel if wumpus is // there, then it is killed wumpus in adjace cave. // void Move(int tunnel) --> move down tunnel to adjace cave if wumpus is // there, player killed. If pits, then player // killed. If bat, then player move to a random // cave. // bool Feel() --> return true if adjacent to a pit // bool Hear() --> return true if adjacent to a bat // bool Smell() --> return true if adjacent to a wumpus // string CurrentName() --> return name of current cave // string AdjacentName(int tunNum) --> return name of cave adajacent via // tunnel number tunNum // int NumGrenades() --> return number of grenades left // int NumWumpi() --> return number of wumpi remaining // bool StillAlive() --> return true if player is alive // bool StillWumpi() --> return true if any wumpi are still alive [game // ends when no wumpi remain.] #include "vector.h" // interface to vector class #include "CPstring.h" class Maze { public: Maze(); void Toss(int tunnel); void Move(int tunnel); bool Feel() const; bool Hear() const; bool Smell() const; string CurrentName() const; string AdjacentName(int tunnel) const; int NumGrenddes() const; int NumWumpi() const; bool StillAlive() const; bool StillWumpi() const; private: enum CaveContents {EMPTY, WUMPUS, PIT, BATS}; struct Cave // struct for storing data on a cave { string name; // name of cave int adj[3]; // indices of adjacent caves CaveContents contents; // contents of cave }; Vector myCaves; // list of all caves int myNumCaves; // number of caves int myNumGrenades; // current number of grenades held int myNumWumpi; // current number of wumpi alive int myCurrentLoc; // current location (cave number) bool myIsAlive; // status of player (alive or dead) int FindEmpty(); // returns # of a random empty cave }; #endif // _WUMPI_H not defined