settings Namespace Reference

Contains the general settings which have a default. More...


Functions

int get_turns (const std::string &value)
 Gets the number of turns.
int get_village_gold (const std::string &value)
 Gets the village gold.
int get_xp_modifier (const std::string &value)
 Gets the xp modifier.
bool use_fog (const std::string &value)
 Returns whether the fog of war should be used.
bool use_random_start_time (const std::string &value)
 Returns whether the random start time feature should be used.
bool use_shroud (const std::string &value)
 Returns whether the shroud should be used.

Variables

const int turns_min = 1
const int turns_max = 100
const int turns_default = 100
const int turns_step = 1


Detailed Description

Contains the general settings which have a default.

These values can be used to initialize the preferences, but also to set map values if these aren't defined.


Function Documentation

int settings::get_turns ( const std::string &  value  ) 

Gets the number of turns.

If no valid value supplied, it will return a default. The value is also range checked. When out of bounds, it will be set to the nearest bound.

Parameters:
value string containing the number of turns
Returns:
the number of turns

Definition at line 27 of file settings.cpp.

References turns_default, turns_max, and turns_min.

Referenced by mp::create::process_event(), and preferences::turns().

int settings::get_village_gold ( const std::string &  value  ) 

Gets the village gold.

If no valid value supplied, it will return a default. The value is also range checked. When out of bounds, it will be set to the nearest bound.

Parameters:
value string containing the village gold
Returns:
the village gold

Definition at line 40 of file settings.cpp.

Referenced by mp::create::process_event(), and preferences::village_gold().

int settings::get_xp_modifier ( const std::string &  value  ) 

Gets the xp modifier.

If no valid value supplied, it will return a default. The value is also range checked. When out of bounds, it will be set to the nearest bound.

Parameters:
value string containing the xp modifier
Returns:
the xp modifier

Definition at line 45 of file settings.cpp.

Referenced by mp::create::process_event(), and preferences::xp_modifier().

bool settings::use_fog ( const std::string &  value  ) 

Returns whether the fog of war should be used.

If no valid value is supplied, it will return a default.

Parameters:
value string containing a boolean value
Returns:
whether or not the fog of war should be used

Definition at line 50 of file settings.cpp.

References utils::string_bool().

Referenced by preferences::fog(), and mp::create::process_event().

bool settings::use_random_start_time ( const std::string &  value  ) 

Returns whether the random start time feature should be used.

If no valid value is supplied, it will return a default.

Parameters:
value string containing a boolean value
Returns:
whether or not the random start time should be used

Definition at line 55 of file settings.cpp.

References utils::string_bool().

Referenced by mp::create::process_event(), and preferences::random_start_time().

bool settings::use_shroud ( const std::string &  value  ) 

Returns whether the shroud should be used.

If no valid value is supplied, it will return a default.

Parameters:
value string containing a boolean value
Returns:
whether or not the shroud should be used

Definition at line 60 of file settings.cpp.

References utils::string_bool().

Referenced by mp::create::process_event(), and preferences::shroud().


Variable Documentation

const int settings::turns_default = 100

Definition at line 44 of file settings.hpp.

Referenced by get_turns().

const int settings::turns_max = 100

Definition at line 43 of file settings.hpp.

Referenced by mp::create::create(), and get_turns().

const int settings::turns_min = 1

Definition at line 42 of file settings.hpp.

Referenced by mp::create::create(), and get_turns().

const int settings::turns_step = 1

Definition at line 45 of file settings.hpp.

Referenced by mp::create::create().


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