예제 #1
0
void replay_savegame::write_game(config_writer &out) {
	savegame::write_game(out);
	
	gamestate().write_carryover(out);
	out.write_child("replay_start", gamestate().replay_start());
	out.write_child("replay", gamestate().replay_data);

}
예제 #2
0
void ingame_savegame::write_game(config_writer &out) {
	log_scope("write_game");

	savegame::write_game(out);
	
	gamestate().write_carryover(out);
	out.write_child("snapshot",snapshot());
	out.write_child("replay_start", gamestate().replay_start());
	out.write_child("replay", gamestate().replay_data);
}
예제 #3
0
void ingame_savegame::write_game(config_writer &out) {
	log_scope("write_game");

	savegame::write_game(out);

	gamestate().write_carryover(out);
	out.write_child("snapshot",gamestate().get_starting_pos());
	out.write_child("replay_start", gamestate().replay_start());
	out.open_child("replay");
	gamestate().get_replay().write(out);
	out.close_child("replay");
}
예제 #4
0
파일: game_data.cpp 프로젝트: Kanac/wesnoth
void game_data::write_config(config_writer& out){
	out.write_key_val("scenario", scenario_);
	out.write_key_val("next_scenario", next_scenario_);

	out.write_key_val("random_seed", lexical_cast<std::string>(rng_.get_random_seed()));
	out.write_key_val("random_calls", lexical_cast<std::string>(rng_.get_random_calls()));
	out.write_child("variables", variables_);

	config cfg;
	wml_menu_items_.to_config(cfg);
	out.write_child("menu_item", cfg);
}
예제 #5
0
void replay_savegame::write_game(config_writer &out) {
	savegame::write_game(out);

	gamestate().write_carryover(out);
	out.write_child("replay_start", gamestate().replay_start());

	out.open_child("replay");
	gamestate().get_replay().write(out);
	out.close_child("replay");

}
예제 #6
0
void savegame::write_game(config_writer &out) const
{
	log_scope("write_game");

	out.write_key_val("version", game_config::version);
	out.write_key_val("next_underlying_unit_id", lexical_cast<std::string>(n_unit::id_manager::instance().get_save_id()));
	gamestate_.write_config(out, false);
	out.write_child("snapshot",snapshot_);
	out.open_child("statistics");
	statistics::write_stats(out);
	out.close_child("statistics");
}
예제 #7
0
void savegame::write_game(config_writer &out) const
{
	config cfg = gamestate_.classification().to_config();
	BOOST_FOREACH (const config::attribute& i, cfg.attribute_range()) {
		out.write_key_val(i.first, i.second);
	}
	int duration = gamestate_.duration(time(NULL));
	out.write_key_val("duration", lexical_cast<std::string>(duration));

	out.write_key_val("random_seed", lexical_cast<std::string>(gamestate_.rng().get_random_seed()));
	out.write_key_val("random_calls", lexical_cast<std::string>(gamestate_.rng().get_random_calls()));

	// update newest rpg to variables
	gamestate_.rpg_2_variable();
	out.write_child("variables", gamestate_.get_variables());

	for (std::map<std::string, wml_menu_item *>::const_iterator j=gamestate_.wml_menu_items.begin();
	    j!=gamestate_.wml_menu_items.end(); ++j) {
		out.open_child("menu_item");
		out.write_key_val("id", j->first);
		out.write_key_val("image", j->second->image);
		out.write_key_val("description", j->second->description);
		out.write_key_val("needs_select", (j->second->needs_select) ? "yes" : "no");
		if(!j->second->show_if.empty())
			out.write_child("show_if", j->second->show_if);
		if(!j->second->filter_location.empty())
			out.write_child("filter_location", j->second->filter_location);
		if(!j->second->command.empty())
			out.write_child("command", j->second->command);
		out.close_child("menu_item");
	}

	out.write_child("snapshot", snapshot_);
/*
	out.open_child("statistics");
	statistics::write_stats(out);
	out.close_child("statistics");
*/
	if (!gamestate_.replay_data_dbg.child("replay12")) {
		out.write_child("replay12", gamestate_.replay_data_dbg);
	}
}