#include <callable_objects.hpp>
Public Member Functions | |
attack_callable (const map_location &move_from, const map_location &src, const map_location &dst, int weapon) | |
const map_location & | move_from () const |
const map_location & | src () const |
const map_location & | dst () 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_input > | inputs () 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_object & | operator= (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_ |
Definition at line 48 of file callable_objects.hpp.
game_logic::attack_callable::attack_callable | ( | const map_location & | move_from, |
const map_location & | src, | ||
const map_location & | dst, | ||
int | weapon | ||
) |
Definition at line 115 of file callable_objects.cpp.
References game_logic::formula_callable::ATTACK_C, and game_logic::formula_callable::type_.
|
inline |
Definition at line 62 of file callable_objects.hpp.
References battle_context_unit_stats::attack_num, and battle_context::get_defender_stats().
Referenced by do_compare().
|
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().
|
inline |
|
privatevirtual |
Reimplemented from game_logic::formula_callable.
Definition at line 137 of file callable_objects.cpp.
References game_logic::FORMULA_READ_ONLY.
|
privatevirtual |
Implements game_logic::formula_callable.
Definition at line 125 of file callable_objects.cpp.
References dst_, move_from_, and src_.
|
inline |
Definition at line 58 of file callable_objects.hpp.
References move_from_.
Referenced by do_compare().
|
inline |
|
inline |
Definition at line 61 of file callable_objects.hpp.
References battle_context_unit_stats::attack_num, and battle_context::get_attacker_stats().
Referenced by do_compare().
|
private |
Definition at line 50 of file callable_objects.hpp.
|
private |
Definition at line 49 of file callable_objects.hpp.
Referenced by do_compare(), dst(), and get_value().
|
private |
Definition at line 49 of file callable_objects.hpp.
Referenced by do_compare(), get_value(), and move_from().
|
private |
Definition at line 49 of file callable_objects.hpp.
Referenced by do_compare(), get_value(), and src().