home · contact · privacy
5b92f2e6ba046f19b0479264825cbd27811f2da3
[plomrogue] / src / client / world.h
1 /* src/client/world.h
2  *
3  * Contains the World struct holding all quasi-global game data together.
4  */
5
6 #ifndef WORLD_H
7 #define WORLD_H
8
9 #include <stdint.h> /* uint8_t, uint16_t */
10 #include <sys/types.h> /* time_t */
11 #include "map.h" /* struct Map */
12 #include "../common/yx_uint8.h" /* struct yx_uint8 */
13 #include "keybindings.h" /* stuct KeyBindingDB */
14 #include "command_db.h" /* struct CommandDB */
15 #include "windows.h" /* WinDB */
16
17
18
19 struct World
20 {
21     struct WinDB winDB; /* data for window management and individual windows */
22     struct CommandDB commandDB; /* data on commands from commands config file */
23     struct KeyBindingDB kb_global; /* globally availabe keybindings */
24     struct KeyBindingDB kb_wingeom; /* Win geometry config view keybindings */
25     struct KeyBindingDB kb_winkeys; /* Win keybindings config view keybindings*/
26     struct Map map; /* game map geometry and content */
27     time_t last_update; /* used for comparison with server outfile' mtime */
28     char * log; /* log of player's activities */
29     char * path_server_in; /* path of server's input fifo */
30     char * path_interface; /* path of interface configuration file */
31     char * path_commands; /* path of commands config file */
32     char * player_inventory; /* one-item-per-line string list of owned items */
33     char * delim; /* delimiter for multi-line blocks in config files */
34     struct yx_uint8 player_pos; /* coordinates of player on map */
35     uint16_t turn; /* world/game turn */
36     uint8_t halfdelay; /* how long to wait for getch() input in io_loop() */
37     uint8_t player_inventory_select; /* index of selected item in inventory */
38     uint8_t player_lifepoints; /* how alive the player is */
39     uint8_t winch; /* if set, SIGWINCH was registered; trigger reset_windows()*/
40 };
41
42
43
44 extern struct World world;
45
46
47
48 #endif