gamestatus.hpp File Reference

#include "filesystem.hpp"
#include "random.hpp"
#include "team.hpp"
#include "unit.hpp"
#include "variable.hpp"
#include <time.h>
#include <string>
#include <vector>

Include dependency graph for gamestatus.hpp:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  time_of_day
 Object which defines the current time of day. More...
struct  wml_menu_item
struct  player_info
 Information on a particular player of the game. More...
class  game_state
class  gamestatus
 Contains the global status of the game. More...
struct  gamestatus::area_time_of_day
struct  save_info
 Holds all the data needed to start a scenario. More...

Enumerations

enum  WRITE_GAME_MODE { WRITE_SNAPSHOT_ONLY, WRITE_FULL_GAME }

Functions

std::string generate_game_uuid ()
std::vector< save_infoget_saves_list (const std::string *dir=NULL, const std::string *filter=NULL)
 Get a list of available saves.
void read_save_file (const std::string &name, config &cfg, std::string *error_log)
void write_game (const game_state &gamestate, config &cfg, WRITE_GAME_MODE mode=WRITE_FULL_GAME)
void write_game (config_writer &out, const game_state &gamestate, WRITE_GAME_MODE mode=WRITE_FULL_GAME)
bool save_game_exists (const std::string &name)
 Returns true iff there is already a savegame with that name.
scoped_ostream open_save_game (const std::string &label)
 Throws game::save_game_failed.
void finish_save_game (config_writer &out, const game_state &gamestate, const std::string &label)
void load_game (const std::string &name, game_state &gamestate, std::string *error_log)
 Load/Save games.
void load_game_summary (const std::string &name, config &cfg_summary, std::string *error_log)
void save_game (const game_state &gamestate)
 Throws gamestatus::save_game_failed.
void delete_game (const std::string &name)
 Delete a savegame.
configsave_summary (const std::string &save)
void write_save_index ()
void replace_underbar2space (std::string &name)


Detailed Description

Definition in file gamestatus.hpp.


Enumeration Type Documentation

Enumerator:
WRITE_SNAPSHOT_ONLY 
WRITE_FULL_GAME 

Definition at line 279 of file gamestatus.hpp.


Function Documentation

void delete_game ( const std::string &  name  ) 

Delete a savegame.

Definition at line 764 of file gamestatus.cpp.

References get_saves_dir(), and replace_space2underbar().

Referenced by clean_saves(), and remove_old_auto_saves().

void finish_save_game ( config_writer out,
const game_state gamestate,
const std::string &  label 
)

std::string generate_game_uuid (  ) 

std::vector<save_info> get_saves_list ( const std::string *  dir = NULL,
const std::string *  filter = NULL 
)

Get a list of available saves.

Definition at line 727 of file gamestatus.cpp.

References file_create_time(), get_files_in_dir(), get_saves_dir(), and replace_underbar2space().

Referenced by clean_saves(), dialogs::load_game_dialog(), and remove_old_auto_saves().

void load_game ( const std::string &  name,
game_state gamestate,
std::string *  error_log 
)

Load/Save games.

Definition at line 813 of file gamestatus.cpp.

References cfg, copy_era(), game_state::game_state(), log_scope, and read_save_file().

void load_game_summary ( const std::string &  name,
config cfg_summary,
std::string *  error_log 
)

Definition at line 824 of file gamestatus.cpp.

References cfg, extract_summary_from_config(), log_scope, and read_save_file().

scoped_ostream open_save_game ( const std::string &  label  ) 

void read_save_file ( const std::string &  name,
config cfg,
std::string *  error_log 
)

void replace_underbar2space ( std::string &  name  ) 

Definition at line 112 of file gamestatus.cpp.

Referenced by get_saves_list(), and dialogs::show_objectives().

void save_game ( const game_state gamestate  ) 

Throws gamestatus::save_game_failed.

Definition at line 868 of file gamestatus.cpp.

References preferences::compress_saves(), finish_save_game(), game_state::label, open_save_game(), PACKAGE, and write_game().

Referenced by play_game().

bool save_game_exists ( const std::string &  name  ) 

Returns true iff there is already a savegame with that name.

Definition at line 752 of file gamestatus.cpp.

References preferences::compress_saves(), file_exists(), get_saves_dir(), and replace_space2underbar().

Referenced by play_controller::expand_autosaves(), and dialogs::get_save_name().

config& save_summary ( const std::string &  save  ) 

void write_game ( config_writer out,
const game_state gamestate,
WRITE_GAME_MODE  mode = WRITE_FULL_GAME 
)

void write_game ( const game_state gamestate,
config cfg,
WRITE_GAME_MODE  mode 
)

void write_save_index (  ) 


Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs