46 std::vector<battle_context>&& weapons,
47 const int best_weapon);
57 virtual const std::string&
window_id()
const override;
Various functions that implement attacks and attack calculations.
Abstract base class for all modal dialogs.
This shows the dialog for attacking units.
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
int selected_weapon_
The index of the selected weapon.
unit_map::iterator defender_itor_
Iterator pointing to the defender.
virtual const std::string & window_id() const override
The ID of the window to build.
int best_weapon_
The best weapon, aka the one high-lighted.
unit_map::iterator attacker_itor_
Iterator pointing to the attacker.
unit_attack(const unit_map::iterator &attacker_itor, const unit_map::iterator &defender_itor, std::vector< battle_context > &&weapons, const int best_weapon)
void damage_calc_callback()
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
int get_selected_weapon() const
std::vector< battle_context > weapons_
List of all battle contexts used for getting the weapons.
base class of top level items, the only item which needs to store the final canvases to draw on.