The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
game_logic::attack_callable Class Reference

#include <callable_objects.hpp>

Inheritance diagram for game_logic::attack_callable:
Inheritance graph

Public Member Functions

 attack_callable (const map_location &move_from, const map_location &src, const map_location &dst, int weapon)
 
const map_locationmove_from () const
 
const map_locationsrc () const
 
const map_locationdst () const
 
int weapon () const
 
int defender_weapon () const
 
int do_compare (const game_logic::formula_callable *callable) const
 Compare two attacks in deterministic way or compare pointers (nondeterministic in consequent game runs) if method argument is not attack_callable. More...
 
- Public Member Functions inherited from game_logic::formula_callable
 formula_callable (bool has_self=true)
 
variant query_value (const std::string &key) const
 
void mutate_value (const std::string &key, const variant &value)
 
std::vector< formula_inputinputs () const
 
bool equals (const formula_callable *other) const
 
bool less (const formula_callable *other) const
 
void serialize (std::string &str) const
 
bool has_key (const std::string &key) const
 
- Public Member Functions inherited from reference_counted_object
 reference_counted_object ()
 
 reference_counted_object (const reference_counted_object &)
 
reference_counted_objectoperator= (const reference_counted_object &)
 
virtual ~reference_counted_object ()
 
void add_ref () const
 
void dec_ref () const
 
int refcount () const
 

Private Member Functions

variant get_value (const std::string &key) const
 
void get_inputs (std::vector< game_logic::formula_input > *inputs) const
 

Private Attributes

map_location move_from_
 
map_location src_
 
map_location dst_
 
battle_context bc_
 

Additional Inherited Members

- Protected Types inherited from game_logic::formula_callable
enum  TYPE {
  FORMULA_C, TERRAIN_C, LOCATION_C, UNIT_TYPE_C,
  UNIT_C, ATTACK_TYPE_C, MOVE_PARTIAL_C, MOVE_C,
  ATTACK_C, MOVE_MAP_C
}
 
- Protected Member Functions inherited from game_logic::formula_callable
virtual ~formula_callable ()
 
virtual void set_value (const std::string &key, const variant &value)
 
virtual void serialize_to_string (std::string &) const
 
- Protected Member Functions inherited from reference_counted_object
void turn_reference_counting_off () const
 
- Protected Attributes inherited from game_logic::formula_callable
TYPE type_
 

Detailed Description

Definition at line 48 of file callable_objects.hpp.

Constructor & Destructor Documentation

game_logic::attack_callable::attack_callable ( const map_location move_from,
const map_location src,
const map_location dst,
int  weapon 
)

Member Function Documentation

int game_logic::attack_callable::defender_weapon ( ) const
inline
int game_logic::attack_callable::do_compare ( const game_logic::formula_callable callable) const
virtual

Compare two attacks in deterministic way or compare pointers (nondeterministic in consequent game runs) if method argument is not attack_callable.

Reimplemented from game_logic::formula_callable.

Definition at line 143 of file callable_objects.cpp.

References defender_weapon(), game_logic::formula_callable::do_compare(), map_location::do_compare(), dst(), dst_, move_from(), move_from_, src(), src_, and weapon().

const map_location& game_logic::attack_callable::dst ( ) const
inline

Definition at line 60 of file callable_objects.hpp.

References dst_.

Referenced by do_compare().

void game_logic::attack_callable::get_inputs ( std::vector< game_logic::formula_input > *  inputs) const
privatevirtual

Reimplemented from game_logic::formula_callable.

Definition at line 137 of file callable_objects.cpp.

References game_logic::FORMULA_READ_ONLY.

variant game_logic::attack_callable::get_value ( const std::string key) const
privatevirtual

Implements game_logic::formula_callable.

Definition at line 125 of file callable_objects.cpp.

References dst_, move_from_, and src_.

const map_location& game_logic::attack_callable::move_from ( ) const
inline

Definition at line 58 of file callable_objects.hpp.

References move_from_.

Referenced by do_compare().

const map_location& game_logic::attack_callable::src ( ) const
inline

Definition at line 59 of file callable_objects.hpp.

References src_.

Referenced by do_compare().

int game_logic::attack_callable::weapon ( ) const
inline

Member Data Documentation

battle_context game_logic::attack_callable::bc_
private

Definition at line 50 of file callable_objects.hpp.

map_location game_logic::attack_callable::dst_
private

Definition at line 49 of file callable_objects.hpp.

Referenced by do_compare(), dst(), and get_value().

map_location game_logic::attack_callable::move_from_
private

Definition at line 49 of file callable_objects.hpp.

Referenced by do_compare(), get_value(), and move_from().

map_location game_logic::attack_callable::src_
private

Definition at line 49 of file callable_objects.hpp.

Referenced by do_compare(), get_value(), and src().


The documentation for this class was generated from the following files: