home · contact · privacy
Fixed bug that led to endless loop in nearest_enemy_dir().
[plomrogue] / src / main.h
index 9c04273959e8c5e197058494b3bd6c438d6e29f0..1ade736826d9ce196a5be682403996ddf94351cc 100644 (file)
@@ -1,24 +1,45 @@
+/* main.h
+ *
+ * Contains the World struct holding all game data together.
+ */
+
 #ifndef MAIN_H
 #define MAIN_H
 
-#include <stdint.h>
-
+#include <stdint.h> /* for uint32_t*/
+#include "keybindings.h" /* for KeyBiData struct */
 struct WinMeta;
-struct Win;
-struct KeyBinding;
-struct KeysWinData;
+struct WinConf;
 struct Map;
+struct MapObjDef;
+struct MapObj;
+struct MapObjAct;
+
+
+
+struct World
+{
+    char interactive;                 /* 1: playing; 0: record playback. */
+    struct KeyBiData kb_global;       /* Global keybindings. */
+    struct KeyBiData kb_wingeom;      /* Window geometry config keybindings. */
+    struct KeyBiData kb_winkeys;      /* Window keybinding config keybindings.*/
+    uint32_t seed;                    /* Randomness seed. */
+    uint32_t mapseed;                 /* Initial randomness seed used for map.*/
+    uint32_t turn;                    /* Current game turn. */
+    uint16_t score;                   /* Player's score. */
+    char * log;                       /* Pointer to the game log string. */
+    struct Map * map;                 /* Pointer to the game map cells. */
+    struct CommandDB * cmd_db;        /* Pointer to the command database. */
+    struct WinMeta * wmeta;           /* Pointer to window manager's WinMeta. */
+    struct WinConf * winconfs;        /* Pointer to windows' configurations. */
+    char * winconf_ids;               /* Pointer to string of Winconfs' ids. */
+    uint8_t map_obj_count;            /* Counts map objects generated so far. */
+    struct MapObjDef * map_obj_defs;  /* Map object type definitions chain. */
+    struct MapObj * map_objs;         /* Pointer to map objects chain start. */
+    uint8_t inventory_sel;            /* Player's inventory selection index. */
+    struct MapObjAct * map_obj_acts;  /* Pointer to map object actions chain. */
+} world;
+
 
-struct World {
-  char interactive;
-  struct KeyBinding * keybindings;
-  struct KeysWinData * keyswindata;
-  uint32_t seed;
-  uint32_t turn;
-  char * log;
-  struct Map * map;
-  struct Item * item;
-  struct Monster * monster;
-  struct Player * player; };
 
 #endif