home · contact · privacy
Load last world state from save file, not from re-stepping record file.
[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 <stdio.h> /* define FILE */
11 #include "../common/map.h" /* struct Map */
12 struct ThingType;
13 struct ThingAction;
14 struct Thing;
15
16
17
18 struct World
19 {
20     FILE * file_in; /* Input stream on file at .path_in. */
21     FILE * file_out; /* Output stream on file at .path_out. */
22     struct Map map; /* Game map. */
23     struct ThingType * thing_types; /* Thing type definitions. */
24     struct ThingAction * thing_actions; /* Thing action definitions. */
25     struct Thing * things; /* All physical things of the game world. */
26     char * log; /* Logs the game events from the player's view. */
27     char * server_test; /* String uniquely identifying server process. */
28     char * queue; /* Stores un-processed messages read from the input file. */
29     uint32_t queue_size;/* Length of .queue sequence of \0-terminated strings.*/
30     uint32_t seed; /* Randomness seed. */
31     uint32_t seed_map; /* Map seed. */
32     uint16_t replay; /* Turn up to which to replay game. No replay if zero. */
33     uint16_t turn; /* Current game turn. */
34     uint16_t last_update_turn; /* Last turn the .path_out file was updated. */
35     uint8_t player_type; /* Thing type that player will start as. */
36     uint8_t is_verbose; /* Should server send debugging info to stdout? */
37     uint8_t enemy_fov; /* != 0 if non-player actors only see field of view. */
38 };
39
40 extern struct World world;
41
42
43
44 #endif