Okay, I'm making an RPG (I know, who isn't?)
However, I hadn't run into any problems I couldn't fix until now.
Here is the code that most likely has the bug in it.
Code:
//item.h"
#include "player.h"
#ifndef H_ITEM
#define H_ITEM
class Item
{
public:
int cost;
protected:
Player *owner;
};
class equipment : public Item
{
bool equipped;
virtual void equip(void);
};
class weapon : public equipment
{
int strbonus;
};
class armor : public equipment
{
int defbonus;
};
#endif
//player.h//
#include "item.h"
#ifndef H_PLAYER
#define H_PLAYER
class creature
{
public:
char name[15];
char desc[50];
int hp;
int mf;
Item *inv[20];
creature(char n[15],int s,int a,int v, int e);
~creature();
protected:
int mmf;
int mhp;
int str;
int agi;
int vit;
int enr;
};
class Monster : public creature
{
int soul_type;
};
class Player : public creature
{
public:
Player(char name[15],int s,int a,int v,int e);
~Player();
int gold;
int souls;
bool SaveChara(char *filename);
bool LoadChara(char *filename);
};
#endif
Sorry about the bad identation, and the lack of knowledge on my part...
EDIT:
Forgot to post the compiling errors.
! player.h(13,13): Type name expected
! player.h(13,13): Declaration missing ;