settings.hpp

Go to the documentation of this file.
00001 /* $Id: settings.hpp 26358 2008-05-03 13:51:13Z mordante $ */
00002 /*
00003    Copyright (C) 2007 - 2008 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 version 2
00008    or at your option any later version.
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY.
00011 
00012    See the COPYING file for more details.
00013 */
00014 
00015 //! @file src/settings.hpp
00016 //! General settings and defaults for scenarios.
00017 
00018 #ifndef SETTINGS_HPP_INCLUDED
00019 #define SETTINGS_HPP_INCLUDED
00020 
00021 #include <string>
00022 
00023 /**
00024  * Contains the general settings which have a default.
00025  * These values can be used to initialize the preferences,
00026  * but also to set map values if these aren't defined.
00027  */
00028 
00029 namespace settings {
00030 
00031     /**
00032      *  Gets the number of turns.
00033      *  If no valid value supplied, it will return a default.
00034      *  The value is also range checked.
00035      *  When out of bounds, it will be set to the nearest bound.
00036      *
00037      *  @param value        string containing the number of turns
00038      *
00039      *  @returns            the number of turns
00040      */
00041     int get_turns(const std::string& value);
00042     const int turns_min = 1;          //< minimum number of turns
00043     const int turns_max = 100;        //< maximum number of turns
00044     const int turns_default = 100;    //< default number of turns
00045     const int turns_step = 1;         //< slider step size for turns
00046 
00047     /**
00048      *  Gets the village gold.
00049      *  If no valid value supplied, it will return a default.
00050      *  The value is also range checked.
00051      *  When out of bounds, it will be set to the nearest bound.
00052      *
00053      *  @param value        string containing the village gold
00054      *
00055      *  @returns            the village gold
00056      */
00057     int get_village_gold(const std::string& value);
00058 
00059     /**
00060      *  Gets the xp modifier.
00061      *  If no valid value supplied, it will return a default.
00062      *  The value is also range checked.
00063      *  When out of bounds, it will be set to the nearest bound.
00064      *
00065      *  @param value        string containing the xp modifier
00066      *
00067      *  @returns            the xp modifier
00068      */
00069     int get_xp_modifier(const std::string& value);
00070 
00071     /**
00072      * Returns whether the fog of war should be used.
00073      * If no valid value is supplied, it will return a default.
00074      *
00075      * @param value         string containing a boolean value
00076      *
00077      * @returns             whether or not the fog of war should be used
00078      */
00079     bool use_fog(const std::string& value);
00080 
00081     /**
00082      * Returns whether the random start time feature should be used.
00083      * If no valid value is supplied, it will return a default.
00084      *
00085      * @param value         string containing a boolean value
00086      *
00087      * @returns             whether or not the random start time should be used
00088      */
00089     bool use_random_start_time(const std::string& value);
00090 
00091     /**
00092      * Returns whether the shroud should be used.
00093      * If no valid value is supplied, it will return a default.
00094      *
00095      * @param value         string containing a boolean value
00096      *
00097      * @returns             whether or not the shroud should be used
00098      */
00099     bool use_shroud(const std::string& value);
00100 
00101 } // namespace settings
00102 
00103 #endif

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