Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends

wb::attack Class Reference

#include <attack.hpp>

Inheritance diagram for wb::attack:
Inheritance graph
[legend]
Collaboration diagram for wb::attack:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 attack (size_t team_index, bool hidden, unit &mover, const map_location &target_hex, int weapon_choice, const pathfind::marked_route &route, arrow_ptr arrow, fake_unit_ptr fake_unit)
 attack (config const &, bool hidden)
virtual ~attack ()
virtual std::ostream & print (std::ostream &s) const
virtual void accept (visitor &v)
virtual void execute (bool &success, bool &complete)
 Output parameters: success: Whether or not to continue an execute-all after this execution complete: Whether or not to delete this action after execution.
virtual void apply_temp_modifier (unit_map &unit_map)
 Applies temporarily the result of this action to the specified unit map.
virtual void remove_temp_modifier (unit_map &unit_map)
 Removes the result of this action from the specified unit map.
virtual void draw_hex (const map_location &hex)
 Gets called by display when drawing a hex, to allow actions to draw to the screen.
map_location const & get_target_hex () const
virtual config to_config () const
 Constructs and returns a config object representing this object.

Protected Member Functions

boost::shared_ptr< attackshared_from_this ()

Private Member Functions

void init ()
virtual void do_hide ()
 Called by the non-virtual hide() and show(), respectively.
virtual void do_show ()
void invalidate ()
 invalidates the move-destination and attack-target hexes

Private Attributes

map_location target_hex_
 the target of the attack
int weapon_choice_
int attack_movement_cost_
int temp_movement_subtracted_

Friends

class validate_visitor
class highlight_visitor

Detailed Description

Definition at line 28 of file attack.hpp.


Constructor & Destructor Documentation

attack::attack ( size_t  team_index,
bool  hidden,
unit mover,
const map_location target_hex,
int  weapon_choice,
const pathfind::marked_route route,
arrow_ptr  arrow,
fake_unit_ptr  fake_unit 
)

Definition at line 44 of file attack.cpp.

References get_target_hex(), and print().

Here is the call graph for this function:

attack::attack ( config const &  cfg,
bool  hidden 
)

Definition at line 55 of file attack.cpp.

References ai::registry::init().

Here is the call graph for this function:

attack::~attack (  )  [virtual]

Definition at line 81 of file attack.cpp.


Member Function Documentation

void attack::accept ( visitor v  )  [virtual]

Reimplemented from wb::move.

Definition at line 86 of file attack.cpp.

void attack::apply_temp_modifier ( unit_map unit_map  )  [virtual]

Applies temporarily the result of this action to the specified unit map.

Reimplemented from wb::move.

Definition at line 138 of file attack.cpp.

virtual void wb::attack::do_hide (  )  [inline, private, virtual]

Called by the non-virtual hide() and show(), respectively.

Reimplemented from wb::move.

Definition at line 67 of file attack.hpp.

References invalidate().

Here is the call graph for this function:

virtual void wb::attack::do_show (  )  [inline, private, virtual]

Reimplemented from wb::move.

Definition at line 68 of file attack.hpp.

References invalidate().

Here is the call graph for this function:

void attack::draw_hex ( const map_location hex  )  [virtual]

Gets called by display when drawing a hex, to allow actions to draw to the screen.

Reimplemented from wb::move.

Definition at line 178 of file attack.cpp.

void attack::execute ( bool &  success,
bool &  complete 
) [virtual]

Output parameters: success: Whether or not to continue an execute-all after this execution complete: Whether or not to delete this action after execution.

Reimplemented from wb::move.

Definition at line 102 of file attack.cpp.

References wb::move::get_dest_hex(), display::invalidate(), resources::screen, and target_hex_.

Here is the call graph for this function:

map_location const& wb::attack::get_target_hex (  )  const [inline]

Definition at line 53 of file attack.hpp.

References target_hex_.

Referenced by attack().

Here is the caller graph for this function:

void attack::init (  )  [private]

Reimplemented from wb::move.

Definition at line 76 of file attack.cpp.

void attack::invalidate (  )  [private]

invalidates the move-destination and attack-target hexes

Definition at line 92 of file attack.cpp.

Referenced by do_hide(), and do_show().

Here is the caller graph for this function:

std::ostream & attack::print ( std::ostream &  s  )  const [virtual]

Reimplemented from wb::move.

Definition at line 37 of file attack.cpp.

Referenced by attack().

Here is the caller graph for this function:

void attack::remove_temp_modifier ( unit_map unit_map  )  [virtual]

Removes the result of this action from the specified unit map.

Reimplemented from wb::move.

Definition at line 163 of file attack.cpp.

References unit::attacks_left(), wb::move::fake_unit_, and unit::movement_left().

Here is the call graph for this function:

boost::shared_ptr<attack> wb::attack::shared_from_this (  )  [inline, protected]

Reimplemented from wb::move.

Definition at line 59 of file attack.hpp.

config attack::to_config (  )  const [virtual]

Constructs and returns a config object representing this object.

Reimplemented from wb::move.

Definition at line 209 of file attack.cpp.


Friends And Related Function Documentation

friend class highlight_visitor [friend]

Reimplemented from wb::move.

Definition at line 32 of file attack.hpp.

friend class validate_visitor [friend]

Reimplemented from wb::move.

Definition at line 31 of file attack.hpp.


Member Data Documentation

Definition at line 77 of file attack.hpp.

the target of the attack

Definition at line 74 of file attack.hpp.

Referenced by execute(), and get_target_hex().

Definition at line 78 of file attack.hpp.

Definition at line 76 of file attack.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:26:23 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs