1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
#include <iostream>
#include <string>
#include <vector>
#include <cctype>
using namespace std;
enum en_DIRS {NORTH, EAST, SOUTH, WEST};
enum en_ROOMS {EASTSTREET, WESTSTREET, FRONTYARD_1, FRONTYARD_2, FRONTYARD_3, FRONTYARD_4,
LIVINGROOM_1,LIVINGROOM_2,LIVINGROOM_3,LIVINGROOM_4, KITCHEN_1, KITCHEN_2, KITCHEN_3,
KITCHEN_4, HALLWAY_1, HALLWAY_2, HALLWAY_3, HALLWAY_4, RESTROOM_1, RESTROOM_2,
RESTROOM_3, RESTROOM_4, BEDROOM_1, BEDROOM_2, BEDROOM_3, BEDROOM_4, BEDROOM_5,
BEDROOM_6, BEDROOM_7, BEDROOM_8, HOUSE_1, HOUSE_2, HOUSE_3, HOUSE_4};
enum en_VERBS {GET, DROP, USE, OPEN, CLOSE, EXAMINE, INVENTORY, LOOK, YELL, SIT}; //2 more verbs
enum en_NOUNS {FRIDGE, CHAIR, TABLE, DOOR, MAILBOX, PIZZA, GARBAGECAN, WOMAN, MAN, KID, BIKE, CAR,BAT, NEWSPAPER, LAWNMOWER}; //make 15+ nouns
// New nouns = FRIDGE, CHAIR, TABLE, DOOR, MAILBOX, PIZZA, GARBAGECAN, WOMAN, MAN, KID, BIKE, CAR,
// BAT, NEWSPAPER, LAWNMOWER
const int NONE= -1;
const int DIRS = 4;
const int ROOMS = 34; // make 30 rooms
const int VERBS = 10; // make 2 more verbs with appropriate actions
const int NOUNS = 15;
class Words
{
public:
Words();
string word;
int code;
};
Words::Words()
{
}
class Room
{
private:
int m_nSmelly;
public:
int getSmelly();
void setSmelly(int smelly);
Room();
~Room();
Room(string desc, int exitNORTH, int exitEAST, int exitSOUTH, int exitWEST);
string description;
int exits_to_room [DIRS];
};
Room::Room()
{
}
Room::~Room()
{
}
int Room::getSmelly()
{
return m_nSmelly;
}
void Room::setSmelly(int smelly)
{
m_nSmelly = smelly;
}
Room::Room(string desc, int exitNORTH, int exitEAST, int exitSOUTH, int exitWEST)
{
description = desc;
exits_to_room[NORTH] = exitNORTH;
exits_to_room[EAST] = exitEAST;
exits_to_room[SOUTH] = exitSOUTH;
exits_to_room[WEST] = exitWEST;
}
class Noun
{
public:
Noun();
string word;
string description;
int code;
int location;
bool can_carry;
};
Noun::Noun()
{
}
|