gui/dialogs/unit_attack.hpp

Go to the documentation of this file.
00001 /* $Id: unit_attack.hpp 52533 2012-01-07 02:35:17Z shadowmaster $ */
00002 /*
00003    Copyright (C) 2010 - 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 #ifndef GUI_DIALOGS_UNIT_ATTACK_HPP_INCLUDED
00017 #define GUI_DIALOGS_UNIT_ATTACK_HPP_INCLUDED
00018 
00019 #include "actions.hpp"
00020 #include "gui/dialogs/dialog.hpp"
00021 #include "unit_map.hpp"
00022 
00023 namespace gui2 {
00024 
00025 class tunit_attack
00026     : public tdialog
00027 {
00028 public:
00029     tunit_attack(
00030               const unit_map::iterator& attacker_itor
00031             , const unit_map::iterator& defender_itor
00032             , const std::vector<battle_context>& weapons
00033             , const int best_weapon);
00034 
00035     /***** ***** ***** setters / getters for members ***** ****** *****/
00036 
00037     int get_selected_weapon() const { return selected_weapon_; }
00038 
00039 private:
00040 
00041     /** Inherited from tdialog, implemented by REGISTER_DIALOG. */
00042     virtual const std::string& window_id() const;
00043 
00044     /** Inherited from tdialog. */
00045     void pre_show(CVideo& video, twindow& window);
00046 
00047     /** Inherited from tdialog. */
00048     void post_show(twindow& window);
00049 
00050     /** The index of the selected weapon. */
00051     int selected_weapon_;
00052 
00053     /** Iterator pointing to the attacker. */
00054     unit_map::iterator attacker_itor_;
00055 
00056     /** Iterator pointing to the defender. */
00057     unit_map::iterator defender_itor_;
00058 
00059     /** List of all battle contexts used for getting the weapons. */
00060     std::vector<battle_context> weapons_;
00061 
00062     /** The best weapon, aka the one high-lighted. */
00063     int best_weapon_;
00064 };
00065 
00066 } // namespace gui2
00067 
00068 #endif
00069 
 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