#define WORLD_H
#include <stdint.h> /* uint8_t, uint16_t */
+#include <stdio.h> /* FILE */
#include <sys/types.h> /* time_t */
-#include "../common/map.h" /* struct Map */
-#include "../common/yx_uint16.h" /* struct yx_uint16 */
+#include "map.h" /* struct Map */
+#include "../common/yx_uint8.h" /* struct yx_uint8 */
#include "keybindings.h" /* stuct KeyBindingDB */
#include "command_db.h" /* struct CommandDB */
-#include "windows.h" /* struct WinMeta */
-#include "wincontrol.h" /* WinConfDB */
+#include "windows.h" /* WinDB */
struct World
{
- struct WinMeta wmeta;
- struct WinConfDB winconf_db;
- struct CommandDB cmd_db; /* Command database. */
- struct KeyBindingDB kb_global; /* Global keybindings. */
- struct KeyBindingDB kb_wingeom; /* Window geometry config keybindings. */
- struct KeyBindingDB kb_winkeys; /* Window keybinding config keybindings.*/
- struct Map map; /* Pointer to the game map cells. */
- time_t last_update;
- struct yx_uint16 player_pos;
- char * log;
- char * path_server_in;
- char * player_inventory;
- uint16_t turn;
- uint16_t score;
- uint8_t halfdelay;
- uint8_t player_inventory_select;
- uint8_t player_lifepoints;
+ FILE * file_server_in; /* server input file to write commands to */
+ FILE * file_server_out; /* server output file to read messages from */
+ struct WinDB winDB; /* data for window management and individual windows */
+ struct CommandDB commandDB; /* data on commands from commands config file */
+ struct KeyBindingDB kb_global; /* globally availabe keybindings */
+ struct KeyBindingDB kb_wingeom; /* Win geometry config view keybindings */
+ struct KeyBindingDB kb_winkeys; /* Win keybindings config view keybindings*/
+ struct Map map; /* game map geometry and content */
+ time_t last_update; /* used for comparison with worldstate file's mtime */
+ char * log; /* log of player's activities */
+ char * path_interface; /* path of interface configuration file */
+ char * path_commands; /* path of commands config file */
+ char * player_inventory; /* one-item-per-line string list of owned items */
+ struct yx_uint8 player_pos; /* coordinates of player on map */
+ uint16_t turn; /* world/game turn */
+ uint8_t halfdelay; /* how long to wait for getch() input in io_loop() */
+ uint8_t player_inventory_select; /* index of selected item in inventory */
+ uint8_t player_lifepoints; /* how alive the player is */
+ uint8_t winch; /* if set, SIGWINCH was registered; trigger reset_windows()*/
};