leader_list.hpp

Go to the documentation of this file.
00001 /* $Id: leader_list.hpp 52533 2012-01-07 02:35:17Z shadowmaster $ */
00002 /*
00003    Copyright (C) 2007 - 2012
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 2
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 /** @file */
00017 
00018 #ifndef LEADER_LIST_HPP_INCLUDED
00019 #define LEADER_LIST_HPP_INCLUDED
00020 
00021 namespace gui { class combo; }
00022 
00023 #include "unit_types.hpp"
00024 
00025 class leader_list_manager
00026 {
00027 public:
00028     static const std::string random_enemy_picture;
00029 
00030     leader_list_manager(const std::vector<const config *> &side_list,
00031             gui::combo* leader_combo = NULL, gui::combo* gender_combo = NULL);
00032 
00033     void set_leader_combo(gui::combo* combo);
00034     void set_gender_combo(gui::combo* combo);
00035     void update_leader_list(int side);
00036     void update_gender_list(const std::string& leader);
00037     std::string get_leader() const;
00038     std::string get_gender() const;
00039     void set_leader(const std::string& leader);
00040     void set_gender(const std::string& gender);
00041     void set_color(int color) {color_ = color;};
00042     std::string get_RC_suffix(const std::string& unit_color) const;
00043 
00044 private:
00045     void populate_leader_combo(int selected_index);
00046     std::vector<std::string> leaders_;
00047     std::vector<std::string> genders_;
00048     std::vector<std::string> gender_ids_;
00049     std::vector<const config *> side_list_;
00050     gui::combo* leader_combo_;
00051     gui::combo* gender_combo_;
00052     int color_;
00053 };
00054 
00055 #endif
00056 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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