The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
settings.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2007 - 2016 by Mark de Wever <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 /**
16  * @file
17  * General settings and defaults for scenarios.
18  */
19 
20 #ifndef SETTINGS_HPP_INCLUDED
21 #define SETTINGS_HPP_INCLUDED
22 
23 #include <string>
24 #include "game_classification.hpp"
25 
26 /**
27  * Contains the general settings which have a default.
28  * These values can be used to initialize the preferences,
29  * but also to set map values if these aren't defined.
30  */
31 
32 namespace settings {
33 
34  /**
35  * Gets the number of turns.
36  * If no valid value supplied, it will return a default.
37  * The value is also range checked.
38  * When out of bounds, it will be set to the nearest bound.
39  *
40  * @param value string containing the number of turns
41  *
42  * @returns the number of turns
43  */
44  int get_turns(const std::string& value);
45  const int turns_min = 1; /**< minimum number of turns */
46  const int turns_max = 100; /**< maximum number of turns */
47  const int turns_default = 100; /**< default number of turns */
48  const int turns_step = 1; /**< slider step size for turns */
49 
50  /**
51  * Gets the village gold.
52  * If no valid value supplied, it will return a default.
53  * The default is 1 for singleplayer, and 2 for multiplayer.
54  * The value is also range checked.
55  * When out of bounds, it will be set to the nearest bound.
56  *
57  * @param value string containing the village gold
58  *
59  * @returns the village gold
60  */
62 
63  /**
64  * Gets the village unit level support.
65  * If no valid value supplied, it will return a default.
66  * The value is also range checked.
67  * When out of bounds, it will be set to the nearest bound.
68  *
69  * @param value string containing the village support
70  *
71  * @returns the village support
72  */
74 
75  /**
76  * Gets the xp modifier.
77  * If no valid value supplied, it will return a default.
78  * The value is also range checked.
79  * When out of bounds, it will be set to the nearest bound.
80  *
81  * @param value string containing the xp modifier
82  *
83  * @returns the xp modifier
84  */
85  int get_xp_modifier(const std::string& value);
86 
87 } // namespace settings
88 
89 #endif
const int turns_max
maximum number of turns
Definition: settings.hpp:46
game_classification * classification
Definition: resources.cpp:37
int get_village_gold(const std::string &value, const game_classification *classification)
Gets the village gold.
Definition: settings.cpp:42
const int turns_default
default number of turns
Definition: settings.hpp:47
const int turns_step
slider step size for turns
Definition: settings.hpp:48
int get_village_support(const std::string &value)
Gets the village unit level support.
Definition: settings.cpp:47
GLsizei const GLfloat * value
Definition: glew.h:1817
Contains the general settings which have a default.
Definition: settings.cpp:27
int get_xp_modifier(const std::string &value)
Gets the xp modifier.
Definition: settings.cpp:52
const int turns_min
minimum number of turns
Definition: settings.hpp:45
int get_turns(const std::string &value)
Gets the number of turns.
Definition: settings.cpp:29
GLsizei const GLcharARB ** string
Definition: glew.h:4503