The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
game_end_exceptions.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2006 - 2016 by Joerg Hinrichs <[email protected]>
3  wesnoth playturn Copyright (C) 2003 by David White <[email protected]>
4  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #include "game_end_exceptions.hpp"
17 
18 #include "config.hpp"
19 #include "game_config.hpp"
20 
22  : carryover_report(true)
23  , linger_mode(true)
24  , custom_endlevel_music()
25  , reveal_map(true)
26 {}
27 
29  : prescenario_save(true)
30  , replay_save(true)
31  , proceed_to_next_level(false)
32  , is_victory(true)
33  , transient()
34 {
35 }
36 
37 void end_level_data::write(config& cfg) const
38 {
39  cfg["prescenario_save"] = prescenario_save;
40  cfg["replay_save"] = replay_save;
41  cfg["proceed_to_next_level"] = proceed_to_next_level;
42  cfg["is_victory"] = is_victory;
43 }
44 
45 void end_level_data::read(const config& cfg)
46 {
47  prescenario_save = cfg["prescenario_save"].to_bool(true);
48  replay_save = cfg["replay_save"].to_bool(true);
49  proceed_to_next_level = cfg["proceed_to_next_level"].to_bool(true);
50  is_victory = cfg["is_victory"].to_bool(true);
51 }
52 
54 {
55  config r;
56  write(r);
57  return r;
58 }
void read(const config &cfg)
bool prescenario_save
Should a prescenario be created the next game?
bool replay_save
Should a replay save be made?
Contains the exception interfaces used to signal completion of a scenario, campaign or turn...
Definitions for the interface to Wesnoth Markup Language (WML).
config to_config() const
bool proceed_to_next_level
whether to proceed to the next scenario, equals is_victory in sp.
GLdouble GLdouble GLdouble r
Definition: glew.h:1374
void write(config &cfg) const
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:83