I have a class structure like this:
Entity
Creatures and Tiles are Entities
Players and Enemies are Creatures
My problem comes in a header file that includes both enemy.h and tiles.h. I'm not really sure what the problem is, but it will only compile properly if I don't include one of the headers. This is a stripped down version of what I have.
#include "enemy.h"
#include "tiles.h"
class foo
{
public:
list<Entity>* GetTiles();
list<Entity>* GetEnemies();
private:
list<Entity>* tilesList();
list<Entity>* enemiesList();
}
Before I threw in enemy.h and the enemy functions, it compiled properly. enemy.h includes creature.h which includes entity.h. tiles.h includes entity.h
I'm really not all that familiar on how #include really works, but it's obvious that it's the problem. How can I fix this?