home · contact · privacy
MAJOR re-write. Split plomrogue into a server and a client. Re-wrote large parts
[plomrogue] / src / server / world.h
1 /* src/server/world.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> /* uint8_t, uint16_t, uint32_t */
10 #include "../common/map.h" /* struct Map */
11 struct MapObjDef;
12 struct MapObjAct;
13 struct MapObj;
14
15
16
17 struct World
18 {
19     struct Map map;
20     struct MapObjDef * map_obj_defs; /* Map object definitions. */
21     struct MapObjAct * map_obj_acts; /* Map object action definitions. */
22     struct MapObj * map_objs; /* Map objects. */
23     char * log; /* Logs the game events from the player's view. */
24     char * path_in; /* Fifo to receive command messages. */
25     char * path_out; /* File to write the game state as visible to clients.*/
26     char * path_record; /* Record file from which to read the game history. */
27     char * tmp_suffix; /* Appended to paths of files for their tmp versions. */
28     char * queue; /* Stores un-processed messages received via input fifo. */
29     uint32_t queue_size;/* Length of .queue sequence of \0-terminated strings.*/
30     uint32_t seed; /* Randomness seed. */
31     uint16_t replay; /* Turn up to which to replay game. No replay if zero. */
32     uint16_t turn; /* Current game turn. */
33     uint16_t last_update_turn; /* Last turn the .path_out file was updated. */
34     uint16_t score; /* Player's score. */
35     uint8_t is_verbose; /* Should server send debugging info to stdout? */
36     uint8_t map_obj_count; /* Counts map objects generated so far. */
37 };
38
39 extern struct World world;
40
41
42
43 #endif