game_preferences.hpp

Go to the documentation of this file.
00001 /* $Id: game_preferences.hpp 54051 2012-04-30 21:52:38Z brilliand $ */
00002 /*
00003    Copyright (C) 2003 - 2012 by David White <dave@whitevine.net>
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 #ifndef GAME_PREFERENCES_HPP_INCLUDED
00016 #define GAME_PREFERENCES_HPP_INCLUDED
00017 
00018 class gamemap;
00019 class game_state;
00020 class team;
00021 class unit_map;
00022 
00023 #include "preferences.hpp"
00024 
00025 #include <set>
00026 
00027 namespace preferences {
00028 
00029     struct manager
00030     {
00031         manager();
00032         ~manager();
00033 
00034         base_manager base;
00035     };
00036 
00037     bool is_authenticated();
00038     void parse_admin_authentication(const std::string& sender, const std::string& message);
00039 
00040     bool parse_should_show_lobby_join(const std::string& sender, const std::string& message);
00041     int lobby_joins();
00042     void _set_lobby_joins(int show);
00043     enum { SHOW_NONE, SHOW_FRIENDS, SHOW_ALL };
00044 
00045     bool new_lobby();
00046     void set_new_lobby(bool value);
00047 
00048     const std::set<std::string> & get_friends();
00049     const std::set<std::string> & get_ignores();
00050     bool add_friend(const std::string& nick);
00051     bool add_ignore(const std::string& nick);
00052     void add_completed_campaign(const std::string& campaign_id);
00053     void remove_friend(const std::string& nick);
00054     void remove_ignore(const std::string& nick);
00055     bool is_friend(const std::string& nick);
00056     bool is_ignored(const std::string& nick);
00057     bool is_campaign_completed(const std::string& campaign_id);
00058 
00059     const std::vector<game_config::server_info>& server_list();
00060 
00061     std::string network_host();
00062     void set_network_host(const std::string& host);
00063 
00064     unsigned int get_ping_timeout();
00065 
00066     std::string campaign_server();
00067     void set_campaign_server(const std::string& host);
00068 
00069     /**
00070      * Returns whether the MP username is stored wrapped in markers.
00071      *
00072      * New usernames are stored in a specific format to force string interpretation
00073      * (due to bug #16571).
00074      */
00075     bool wrap_login();
00076     void set_wrap_login(bool wrap);
00077 
00078     std::string login();
00079     void set_login(const std::string& username);
00080 
00081     // If password remembering is turned off use
00082     // prv::password instead. This way we will not
00083     // have to worry about whether to remember the
00084     // password or not anywhere else in the code.
00085     //
00086     // It is put into a separate namespace to make clear
00087     // it is "private" and not supposed to be edit outside
00088     // of the preferences functions.
00089     namespace prv {
00090         extern std::string password;
00091     }
00092 
00093     /**
00094      * Returns whether the password is stored wrapped in markers.
00095      *
00096      * New passwords are stored in a specific format to force string interpretation
00097      * (due to bug #16571).
00098      */
00099     bool wrap_password();
00100     void set_wrap_password(bool wrap);
00101 
00102     std::string password();
00103     void set_password(const std::string& password);
00104 
00105     bool remember_password();
00106     void set_remember_password(bool remember);
00107 
00108     bool turn_dialog();
00109     void set_turn_dialog(bool ison);
00110 
00111     bool enable_whiteboard_mode_on_start();
00112     void set_enable_whiteboard_mode_on_start(bool value);
00113 
00114     bool hide_whiteboard();
00115     void set_hide_whiteboard(bool value);
00116 
00117     bool show_combat();
00118 
00119     bool allow_observers();
00120     void set_allow_observers(bool value);
00121 
00122     bool shuffle_sides();
00123     void set_shuffle_sides(bool value);
00124 
00125     bool use_map_settings();
00126     void set_use_map_settings(bool value);
00127 
00128     int mp_server_warning_disabled();
00129     void set_mp_server_warning_disabled(int value);
00130 
00131     void set_mp_server_program_name(const std::string&);
00132     std::string get_mp_server_program_name();
00133 
00134     bool random_start_time();
00135     void set_random_start_time(bool value);
00136 
00137     bool fog();
00138     void set_fog(bool value);
00139 
00140     bool shroud();
00141     void set_shroud(bool value);
00142 
00143     int turns();
00144     void set_turns(int value);
00145 
00146     bool skip_mp_replay();
00147     void set_skip_mp_replay(bool value);
00148 
00149     bool countdown();
00150     void set_countdown(bool value);
00151     int countdown_init_time();
00152     void set_countdown_init_time(int value);
00153     int countdown_turn_bonus();
00154     void set_countdown_turn_bonus(int value);
00155     int countdown_reservoir_time();
00156     void set_countdown_reservoir_time(int value);
00157     int countdown_action_bonus();
00158     void set_countdown_action_bonus(int value);
00159 
00160     int village_gold();
00161     void set_village_gold(int value);
00162 
00163     int village_support();
00164     void set_village_support(int value);
00165 
00166     int xp_modifier();
00167     void set_xp_modifier(int value);
00168 
00169     int era();
00170     void set_era(int value);
00171 
00172     int map();
00173     void set_map(int value);
00174 
00175     bool show_ai_moves();
00176     void set_show_ai_moves(bool value);
00177 
00178     void set_show_side_colors(bool value);
00179     bool show_side_colors();
00180 
00181     bool save_replays();
00182     void set_save_replays(bool value);
00183 
00184     bool delete_saves();
00185     void set_delete_saves(bool value);
00186 
00187     void set_ask_delete_saves(bool value);
00188     bool ask_delete_saves();
00189 
00190     void set_interrupt_when_ally_sighted(bool value);
00191     bool interrupt_when_ally_sighted();
00192 
00193     void set_autosavemax(int value);
00194     int autosavemax();
00195 
00196     const int INFINITE_AUTO_SAVES = 61;
00197 
00198     bool show_floating_labels();
00199     void set_show_floating_labels(bool value);
00200 
00201     bool message_private();
00202     void set_message_private(bool value);
00203 
00204     bool show_haloes();
00205     void set_show_haloes(bool value);
00206 
00207 
00208     bool flip_time();
00209     void set_flip_time(bool value);
00210 
00211     // Multiplayer functions
00212     std::string get_chat_timestamp(const time_t& t);
00213     bool chat_timestamping();
00214     void set_chat_timestamping(bool value);
00215 
00216     int chat_lines();
00217     void set_chat_lines(int lines);
00218 
00219     int chat_message_aging();
00220     void set_chat_message_aging(const int aging);
00221 
00222     bool show_all_units_in_help();
00223     void set_show_all_units_in_help(bool value);
00224 
00225     bool compress_saves();
00226 
00227     bool startup_effect();
00228 
00229     std::set<std::string> &encountered_units();
00230     std::set<t_translation::t_terrain> &encountered_terrains();
00231 
00232     std::string custom_command();
00233     void set_custom_command(const std::string& command);
00234 
00235     std::vector<std::string>* get_history(const std::string& id);
00236 
00237     std::string client_type();
00238 
00239     void set_theme(const std::string& theme);
00240     std::string theme();
00241 
00242     bool compare_resolutions(const std::pair<int,int>& lhs, const std::pair<int,int>& rhs);
00243 
00244     // Ask for end turn confirmation
00245     bool yellow_confirm();
00246     bool green_confirm();
00247     bool confirm_no_moves();
00248 
00249     // Add all recruitable units as encountered so that information
00250     // about them are displayed to the user in the help system.
00251     void encounter_recruitable_units(std::vector<team>& teams);
00252     // Add all units that exist at the start to the encountered units so
00253     // that information about them are displayed to the user in the help
00254     // system.
00255     void encounter_start_units(unit_map& units);
00256     // Add all units that are recallable as encountred units.
00257     void encounter_recallable_units(std::vector<team>& teams);
00258     // Add all terrains on the map as encountered terrains.
00259     void encounter_map_terrain(gamemap& map);
00260 
00261 }
00262 
00263 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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