settings.hpp

Go to the documentation of this file.
00001 /* $Id: settings.hpp 54051 2012-04-30 21:52:38Z brilliand $ */
00002 /*
00003    Copyright (C) 2007 - 2012 by Mark de Wever <koraq@xs4all.nl>
00004    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY.
00012 
00013    See the COPYING file for more details.
00014 */
00015 
00016 /**
00017  *  @file
00018  *  General settings and defaults for scenarios.
00019  */
00020 
00021 #ifndef SETTINGS_HPP_INCLUDED
00022 #define SETTINGS_HPP_INCLUDED
00023 
00024 #include <string>
00025 
00026 /**
00027  * Contains the general settings which have a default.
00028  * These values can be used to initialize the preferences,
00029  * but also to set map values if these aren't defined.
00030  */
00031 
00032 namespace settings {
00033 
00034     /**
00035      *  Gets the number of turns.
00036      *  If no valid value supplied, it will return a default.
00037      *  The value is also range checked.
00038      *  When out of bounds, it will be set to the nearest bound.
00039      *
00040      *  @param value        string containing the number of turns
00041      *
00042      *  @returns            the number of turns
00043      */
00044     int get_turns(const std::string& value);
00045     const int turns_min = 1;          //< minimum number of turns
00046     const int turns_max = 100;        //< maximum number of turns
00047     const int turns_default = 100;    //< default number of turns
00048     const int turns_step = 1;         //< slider step size for turns
00049 
00050     /**
00051      *  Gets the village gold.
00052      *  If no valid value supplied, it will return a default.
00053      *  The value is also range checked.
00054      *  When out of bounds, it will be set to the nearest bound.
00055      *
00056      *  @param value        string containing the village gold
00057      *
00058      *  @returns            the village gold
00059      */
00060     int get_village_gold(const std::string& value);
00061 
00062     /**
00063      *  Gets the village unit level support.
00064      *  If no valid value supplied, it will return a default.
00065      *  The value is also range checked.
00066      *  When out of bounds, it will be set to the nearest bound.
00067      *
00068      *  @param value        string containing the village support
00069      *
00070      *  @returns            the village support
00071      */
00072     int get_village_support(const std::string& value);
00073 
00074     /**
00075      *  Gets the xp modifier.
00076      *  If no valid value supplied, it will return a default.
00077      *  The value is also range checked.
00078      *  When out of bounds, it will be set to the nearest bound.
00079      *
00080      *  @param value        string containing the xp modifier
00081      *
00082      *  @returns            the xp modifier
00083      */
00084     int get_xp_modifier(const std::string& value);
00085 
00086 } // namespace settings
00087 
00088 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:03:00 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs