⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adv_def.h

📁 焰火演示
💻 H
字号:
/*--------------------------------------------------------------------------*\
| ADV-DEF.H : defines the adventure world types and externals                |
\*--------------------------------------------------------------------------*/

/*----------------------------*/
/* Location
*/
#define MaxDirs 6       /* Maximum 6 directions used (N E S W U D) */

enum { north, east, south, west, up, down };   /* named directions */

typedef struct   /* room information */
{
  char  *name;             /* description of the room */
  int   link [ MaxDirs ];  /* room connections: N E S W U D */
}
room_type;


/*----------------------------*/
/* objects
*/
typedef struct     /* object information */
{
  char
    *name;         /* name of object */

  int
    init_loc,      /* initial location */
    attr,          /* attribute:  b0=get  (b1=check in get)  b2=look  */
    loc;           /* current location */
}
object_type;


/*----------------------------*/
/* vocabulary
*/
typedef struct          /* vocabulary word */
{
  char *name;           /* words used */
  int num;              /* which object it corresponds to */
}
vocab_type;


/*----------------------------*/
/* externals to be provided by the specific adventure-def file
*/
extern room_type room[];

extern object_type obj [];

/*
  start w/blank string, end w/null string
  {
  "    " , 0 ,
 ...
  "",0
  }
*/
extern vocab_type v_noun [];
extern vocab_type v_verb[];

extern int
  num_verbs, num_nouns,         /* # of verbs and nouns */
  NumLocs, NumObjs, NumDirs;    /* # locations, objects, directions */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -