#include <callable.hpp>
Public Member Functions | |
formula_callable (bool has_self=true) | |
virtual | ~formula_callable () |
formula_callable_ptr | fake_ptr () |
const_formula_callable_ptr | fake_ptr () const |
variant | query_value (const std::string &key) const |
void | mutate_value (const std::string &key, const variant &value) |
formula_input_vector | inputs () const |
virtual void | get_inputs (formula_input_vector &) const |
bool | equals (const formula_callable &other) const |
bool | less (const formula_callable &other) const |
bool | has_key (const std::string &key) const |
void | serialize (std::string &str) const |
void | subscribe_dtor (callable_die_subscriber *d) const |
void | unsubscribe_dtor (callable_die_subscriber *d) const |
Protected Types | |
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 | |
virtual void | set_value (const std::string &key, const variant &) |
virtual int | do_compare (const formula_callable *callable) const |
virtual void | serialize_to_string (std::string &) const |
Static Protected Member Functions | |
template<typename T , typename K > | |
static variant | convert_map (const std::map< T, K > &input_map) |
template<typename T > | |
static variant | convert_set (const std::set< T > &input_set) |
template<typename T > | |
static variant | convert_vector (const std::vector< T > &input_vector) |
static void | add_input (formula_input_vector &inputs, const std::string &key, formula_access access_type=formula_access::read_only) |
Protected Attributes | |
TYPE | type_ |
std::set< callable_die_subscriber * > | dtor_notify |
Private Member Functions | |
virtual variant | get_value (const std::string &key) const =0 |
Private Attributes | |
bool | has_self_ |
Definition at line 29 of file callable.hpp.
|
protected |
Enumerator | |
---|---|
FORMULA_C | |
TERRAIN_C | |
LOCATION_C | |
UNIT_TYPE_C | |
UNIT_C | |
ATTACK_TYPE_C | |
MOVE_PARTIAL_C | |
MOVE_C | |
ATTACK_C | |
MOVE_MAP_C |
Definition at line 169 of file callable.hpp.
|
inlineexplicit |
Definition at line 32 of file callable.hpp.
|
inlinevirtual |
Definition at line 34 of file callable.hpp.
References d, and dtor_notify.
|
inlinestaticprotected |
Definition at line 136 of file callable.hpp.
References inputs().
Referenced by wfl::string_callable::get_inputs(), wfl::list_callable::get_inputs(), wfl::map_callable::get_inputs(), wfl::where_variables::get_inputs(), wfl::attack_map_callable::get_inputs(), wfl::attack_callable::get_inputs(), wfl::move_callable::get_inputs(), wfl::move_partial_callable::get_inputs(), wfl::recall_callable::get_inputs(), wfl::recruit_callable::get_inputs(), wfl::set_unit_var_callable::get_inputs(), wfl::map_formula_callable::get_inputs(), wfl::gamestate_callable::get_inputs(), wfl::event_callable::get_inputs(), wfl::terrain_callable::get_inputs(), wfl::gamemap_callable::get_inputs(), wfl::location_callable::get_inputs(), wfl::attack_type_callable::get_inputs(), wfl::unit_callable::get_inputs(), wfl::unit_type_callable::get_inputs(), wfl::config_callable::get_inputs(), wfl::team_callable::get_inputs(), wfl::color_callable::get_inputs(), wfl::set_var_callable::get_inputs(), wfl::safe_call_callable::get_inputs(), wfl::safe_call_result::get_inputs(), ai::attack_analysis::get_inputs(), and ai::formula_ai::get_inputs().
|
inlinestaticprotected |
Definition at line 104 of file callable.hpp.
References p.
|
inlinestaticprotected |
Definition at line 115 of file callable.hpp.
Referenced by wfl::unit_callable::get_value().
|
inlinestaticprotected |
Definition at line 126 of file callable.hpp.
Referenced by wfl::unit_callable::get_value(), and wfl::unit_type_callable::get_value().
|
inlineprotectedvirtual |
Reimplemented in lua_callable, wfl::config_callable, wfl::unit_type_callable, wfl::unit_callable, wfl::attack_type_callable, wfl::location_callable, wfl::terrain_callable, wfl::move_partial_callable, wfl::move_callable, and wfl::attack_callable.
Definition at line 146 of file callable.hpp.
References type_.
Referenced by wfl::attack_callable::do_compare(), wfl::move_callable::do_compare(), wfl::move_partial_callable::do_compare(), wfl::terrain_callable::do_compare(), wfl::location_callable::do_compare(), wfl::attack_type_callable::do_compare(), wfl::unit_callable::do_compare(), wfl::unit_type_callable::do_compare(), wfl::config_callable::do_compare(), lua_callable::do_compare(), equals(), and less().
|
inline |
Definition at line 72 of file callable.hpp.
References do_compare().
|
inline |
Definition at line 42 of file callable.hpp.
Referenced by ai::stage_side_formulas::do_play_stage(), ai::stage_unit_formulas::do_play_stage(), gui2::image_shape::draw(), gui2::text_shape::draw(), ai::formula_ai::evaluate(), ai::formula_ai::execute_candidate_action(), wfl::attack_callable::execute_self(), wfl::recall_callable::execute_self(), wfl::recruit_callable::execute_self(), wfl::set_unit_var_callable::execute_self(), wfl::set_var_callable::execute_self(), ai::attack_analysis::execute_self(), ai::formula_ai::get_value(), ai::formula_ai::make_action(), and query_value().
|
inline |
Definition at line 46 of file callable.hpp.
|
inlinevirtual |
Reimplemented in image::pixel_callable, ai::formula_ai, ai::attack_analysis, wfl::key_value_pair, wfl::safe_call_result, wfl::safe_call_callable, wfl::set_var_callable, wfl::color_callable, wfl::team_callable, wfl::config_callable, wfl::unit_type_callable, wfl::unit_callable, wfl::attack_type_callable, wfl::location_callable, wfl::gamemap_callable, wfl::terrain_callable, wfl::event_callable, wfl::gamestate_callable, wfl::map_formula_callable, wfl::formula_variant_callable_with_backup, wfl::formula_callable_with_backup, wfl::outcome_callable, wfl::position_callable, wfl::move_map_callable, wfl::set_unit_var_callable, wfl::recruit_callable, wfl::recall_callable, wfl::move_partial_callable, wfl::move_callable, wfl::attack_callable, wfl::attack_map_callable, lua_callable, wfl::where_variables, wfl::dot_callable, wfl::map_callable, wfl::list_callable, and wfl::string_callable.
Definition at line 70 of file callable.hpp.
Referenced by wfl::dot_callable::get_inputs(), wfl::formula_callable_with_backup::get_inputs(), wfl::formula_variant_callable_with_backup::get_inputs(), and inputs().
|
privatepure virtual |
Implemented in image::pixel_callable, wfl::key_value_pair, wfl::safe_call_result, wfl::safe_call_callable, wfl::set_var_callable, wfl::color_callable, wfl::team_callable, wfl::config_callable, wfl::unit_type_callable, wfl::unit_callable, wfl::attack_type_callable, wfl::location_callable, wfl::gamemap_callable, wfl::terrain_callable, wfl::event_callable, wfl::gamestate_callable, wfl::map_formula_callable, wfl::formula_variant_callable_with_backup, wfl::formula_callable_with_backup, wfl::outcome_callable, wfl::position_callable, wfl::move_map_callable, wfl::set_unit_var_callable, wfl::recruit_callable, wfl::recall_callable, wfl::move_partial_callable, wfl::move_callable, wfl::attack_callable, wfl::attack_map_callable, ai::formula_ai, ai::attack_analysis, mock_party, mock_char, lua_callable, wfl::where_variables, wfl::dot_callable, wfl::map_callable, wfl::list_callable, wfl::string_callable, and wfl::fallback_callable.
Referenced by query_value().
|
inline |
Definition at line 82 of file callable.hpp.
References wfl::variant::is_null(), and query_value().
Referenced by gui2::image_shape::draw(), and gui2::text_shape::draw().
|
inline |
Definition at line 63 of file callable.hpp.
References get_inputs().
Referenced by add_input(), wfl::string_callable::get_inputs(), wfl::list_callable::get_inputs(), wfl::map_callable::get_inputs(), wfl::dot_callable::get_inputs(), wfl::where_variables::get_inputs(), wfl::attack_map_callable::get_inputs(), wfl::attack_callable::get_inputs(), wfl::move_callable::get_inputs(), wfl::move_partial_callable::get_inputs(), wfl::recall_callable::get_inputs(), wfl::recruit_callable::get_inputs(), wfl::set_unit_var_callable::get_inputs(), wfl::formula_callable_with_backup::get_inputs(), wfl::formula_variant_callable_with_backup::get_inputs(), wfl::map_formula_callable::get_inputs(), wfl::gamestate_callable::get_inputs(), wfl::event_callable::get_inputs(), wfl::terrain_callable::get_inputs(), wfl::gamemap_callable::get_inputs(), wfl::location_callable::get_inputs(), wfl::attack_type_callable::get_inputs(), wfl::unit_callable::get_inputs(), wfl::unit_type_callable::get_inputs(), wfl::config_callable::get_inputs(), wfl::team_callable::get_inputs(), wfl::color_callable::get_inputs(), wfl::set_var_callable::get_inputs(), wfl::safe_call_callable::get_inputs(), wfl::safe_call_result::get_inputs(), ai::attack_analysis::get_inputs(), ai::formula_ai::get_inputs(), and ai::formula_ai::on_create().
|
inline |
Definition at line 77 of file callable.hpp.
References do_compare().
|
inline |
Definition at line 58 of file callable.hpp.
References set_value().
Referenced by ai::formula_ai::set_value().
|
inline |
Definition at line 50 of file callable.hpp.
References fake_ptr(), get_value(), and has_self_.
Referenced by gui2::image_shape::draw(), gui2::text_shape::draw(), wfl::identifier_expression::execute(), gui2::rich_label::get_image_size(), gui2::rich_label::get_text_size(), wfl::dot_callable::get_value(), wfl::where_variables::get_value(), wfl::formula_callable_with_backup::get_value(), wfl::formula_variant_callable_with_backup::get_value(), gui2::canvas::get_variable(), and has_key().
|
inline |
Definition at line 89 of file callable.hpp.
References serialize_to_string().
|
inlineprotectedvirtual |
Reimplemented in wfl::key_value_pair, and wfl::location_callable.
Definition at line 161 of file callable.hpp.
Referenced by serialize().
|
inlineprotectedvirtual |
Reimplemented in ai::formula_ai, and wfl::map_formula_callable.
Definition at line 141 of file callable.hpp.
References PLAIN_LOG.
Referenced by mutate_value().
|
inline |
Definition at line 94 of file callable.hpp.
References d, and dtor_notify.
|
inline |
Definition at line 98 of file callable.hpp.
References d, and dtor_notify.
|
mutableprotected |
Definition at line 176 of file callable.hpp.
Referenced by subscribe_dtor(), unsubscribe_dtor(), and ~formula_callable().
|
private |
Definition at line 180 of file callable.hpp.
Referenced by query_value().
|
protected |
Definition at line 174 of file callable.hpp.
Referenced by wfl::attack_callable::attack_callable(), wfl::attack_type_callable::attack_type_callable(), do_compare(), wfl::location_callable::location_callable(), wfl::move_callable::move_callable(), wfl::move_map_callable::move_map_callable(), wfl::move_partial_callable::move_partial_callable(), wfl::terrain_callable::terrain_callable(), wfl::unit_callable::unit_callable(), and wfl::unit_type_callable::unit_type_callable().