One thing I notice is that take for example this
file
Code:
/*********************
* CHARACTER PROTOTYPES
**********************/
#ifndef CHARACTER_CLASS
#define CHARACTER_CLASS
#include <string>
#include "Inventory.h"
#include "Destination.h"
#include "Item.h"
#include "Room.h"
class Character{
private:
string name;
string desc;
bool isPlayer;
string charDesignation;
int maxHP, HP; //hit points
int maxMP, MP; //mana power
int maxST, ST; //stamina
Room* location; //location of character
int stance; //0 = standing | 1 = sitting | 2 = laying down
int hand[2]; //[0]=left | [1]=right, -1 = empty hand
Inventory inventory;
public:
Character();
~Character();
void setName(const string &newName);
void setDesc(const string &newDesc);
void setLocation(Room *newLocation);
void addItem(Item *newItem);
void removeItem(Item *target);
void setHand(int i, int id);
void setIsPlayer(bool status);
string getName();
string getDesc();
Room* getLocation();
int getHand(int i);
void printInventory();
void move(int dir);
void go(string itemName);
void get(string itemName);
void drop(string itemName);
void open(string itemName);
void close(string itemName);
};
#endif
You don't need #include "item.h" or any of the classes
that you only use as a referance. Only then in your .cpp file
that calls functions from item.h and
room.h you include those files.
Code:
#ifndef CHARACTER_CLASS
#define CHARACTER_CLASS
#include <string>
#include "Inventory.h"
class Room;
class Item;
class Character{
private:
string name;
string desc;
bool isPlayer;
string charDesignation;
int maxHP, HP; //hit points
int maxMP, MP; //mana power
int maxST, ST; //stamina
Room* location; //location of character
int stance; //0 = standing | 1 = sitting | 2 = laying down
int hand[2]; //[0]=left | [1]=right, -1 = empty hand
Inventory inventory;
public:
Character();
~Character();
void setName(const string &newName);
void setDesc(const string &newDesc);
void setLocation(Room *newLocation);
void addItem(Item *newItem);
void removeItem(Item *target);
void setHand(int i, int id);
void setIsPlayer(bool status);
string getName();
string getDesc();
Room* getLocation();
int getHand(int i);
void printInventory();
void move(int dir);
void go(string itemName);
void get(string itemName);
void drop(string itemName);
void open(string itemName);
void close(string itemName);
};
#endif