gui/dialogs/unit_create.hpp

Go to the documentation of this file.
00001 /* $Id: unit_create.hpp 52533 2012-01-07 02:35:17Z shadowmaster $ */
00002 /*
00003    Copyright (C) 2009 - 2012 by Ignacio R. Morelle <shadowm2006@gmail.com>
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 #ifndef GUI_DIALOGS_UNIT_CREATE_HPP_INCLUDED
00017 #define GUI_DIALOGS_UNIT_CREATE_HPP_INCLUDED
00018 
00019 #include "gui/dialogs/dialog.hpp"
00020 #include "race.hpp"
00021 
00022 #include <string>
00023 #include <vector>
00024 
00025 namespace gui2 {
00026 
00027 class tunit_create : public tdialog
00028 {
00029 public:
00030     tunit_create();
00031 
00032     /** Unit type choice from the user. */
00033     const std::string& choice() const { return choice_; }
00034 
00035     /** Whether the user actually chose a unit type or not. */
00036     bool no_choice() const { return choice_.empty(); }
00037 
00038     /** Gender choice from the user. */
00039     unit_race::GENDER gender() { return gender_; }
00040 
00041 private:
00042     unit_race::GENDER        gender_;
00043 
00044     std::string              choice_;
00045     std::vector<std::string> type_ids_;
00046 
00047     /** Inherited from tdialog, implemented by REGISTER_DIALOG. */
00048     virtual const std::string& window_id() const;
00049 
00050     /** Inherited from tdialog. */
00051     void pre_show(CVideo& video, twindow& window);
00052 
00053     /** Inherited from tdialog. */
00054     void post_show(twindow& window);
00055 
00056     void gender_toggle_callback(twindow& window);
00057 };
00058 
00059 }
00060 
00061 #endif /* ! GUI_DIALOGS_UNIT_CREATE_HPP_INCLUDED */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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