added copy constructor to game_classification

This commit is contained in:
Eugen Jiresch 2009-06-05 10:01:02 +00:00
parent 9beb622b6a
commit 2c285c93da
2 changed files with 35 additions and 1 deletions

View file

@ -84,6 +84,39 @@ game_classification::game_classification(const config& cfg):
difficulty(cfg["difficulty"])
{}
game_classification::game_classification(const game_classification& gc):
label(),
parent(),
version(),
campaign_type(),
campaign_define(),
campaign_xtra_defines(),
campaign(),
history(),
abbrev(),
scenario(),
next_scenario(),
completion(),
end_text(),
end_text_duration(),
difficulty("NORMAL")
{
label = gc.label;
parent = gc.parent;
version = gc.version;
campaign_type = gc.campaign_type;
campaign_define = gc.campaign_define;
campaign_xtra_defines = gc.campaign_xtra_defines;
campaign = gc.campaign;
history = gc.history;
abbrev = gc.abbrev;
scenario = gc.scenario;
completion = gc.completion;
end_text = gc.end_text;
end_text_duration = gc.end_text_duration;
difficulty = gc.difficulty;
}
config game_classification::to_config()
{
config cfg;
@ -821,7 +854,7 @@ game_state& game_state::operator=(const game_state& state)
rng_ = state.rng_;
players = state.players;
scoped_variables = state.scoped_variables;
classification_ = state.classification_;
classification_ = game_classification(state.classification());
clear_wmi(wml_menu_items);
std::map<std::string, wml_menu_item*>::const_iterator itor;

View file

@ -38,6 +38,7 @@ class game_classification : public savegame_config
public:
game_classification();
game_classification(const config& cfg);
game_classification(const game_classification& gc);
config to_config(); //dummy