我正在编写一个基于DnD-Text-Based的C风格游戏,并且我在编译结构时遇到问题。 这里是我迄今的结构:“房间”前的预期说明符 - 限定符列表
typedef struct stats { //
int strength; //
int wisdom; //
int agility; //
} stats;
typedef struct rooms {
int n_monsters;
int visited;
rooms nentry;
rooms sentry;
rooms wentry;
rooms eentry;
monster *monsters;
} rooms;
typedef struct monster {
int difficulty;
char *name;
char *type;
int hp;
} monster;
typedef struct dungeon {
char *name;
int n_rooms;
rooms *rooms;
} dungeon;
typedef struct player {
int maxhealth;
int curhealth;
int mana;
char *class;
char *condition;
stats stats;
rooms c_room;
} player;
typedef struct game_structure {
player p1;
dungeon d;
} game_structure;
当我编译它,我得到的错误: structure.h:21:错误:符限定符列表前“房”
你能帮我弄清楚这是为什么吗?是因为我从包含房间的结构中呼叫房间?请帮忙。
谢谢!这是最有帮助的,并帮助我了解问题。 – atb 2012-03-05 01:38:59