home · contact · privacy
Made single World struct a global variable, fitted a lot of code to this change,...
[plomrogue] / src / main.h
1 /* main.h
2  *
3  * Contains the World struct holding all game data together.
4  */
5
6 #ifndef MAIN_H
7 #define MAIN_H
8
9 #include <stdint.h> /* for uint32_t*/
10 #include "keybindings.h" /* for KeyBiData struct */
11 struct WinMeta;
12 struct WinConf;
13 struct Win;
14 struct Map;
15 struct MapObjDef;
16 struct MapObj;
17
18
19
20 struct World
21 {
22     char interactive;                 /* 1: playing; 0: record playback. */
23     struct KeyBiData kb_global;       /* Global keybindings. */
24     struct KeyBiData kb_wingeom;      /* Window geometry config keybindings. */
25     struct KeyBiData kb_winkeys;      /* Window keybinding config keybindings.*/
26     uint32_t seed;                    /* Randomness seed. */
27     uint32_t turn;                    /* Current game turn. */
28     uint16_t score;                   /* Player's score. */
29     char * log;                       /* Pointer to the game log string. */
30     struct Map * map;                 /* Pointer to the game map cells. */
31     struct CommandDB * cmd_db;        /* Pointer to the command database. */
32     struct WinMeta * wmeta;           /* Pointer to window manager's WinMeta. */
33     struct WinConf * winconfs;        /* Pointer to windows' configurations. */
34     char * winconf_ids;               /* Pointer to string of Winconfs' ids. */
35     uint8_t map_obj_count;            /* Counts map objects generated so far. */
36     struct MapObjDef * map_obj_defs;  /* Map object type definitions chain. */
37     struct MapObj * map_objs;         /* Pointer to map objects chain start. */
38     uint8_t inventory_select;         /* Player's inventory selection index. */
39     uint8_t old_inventory_select;     /* Temporarily stores for recordfile */
40 } world;                              /* writing inventory selection index. */
41
42
43
44 #endif