33 #define LOG_AI LOG_STREAM(info, log_formula_ai)
34 #define WRN_AI LOG_STREAM(warn, log_formula_ai)
35 #define ERR_AI LOG_STREAM(err, log_formula_ai)
43 :
stage(context,cfg), fai_(fai)
63 if (
i->formula_manager().has_formula() ||
i->formula_manager().has_loop_formula()) {
65 if (
i->formula_manager().has_priority_formula()) {
68 if (priority_formula) {
73 WRN_AI <<
"priority formula skipped, maybe it's empty or incorrect";
76 if(
e.filename ==
"formula")
78 fai_.
handle_exception(
e,
"Unit priority formula error for unit: '" +
i->type_id() +
"' standing at (" + std::to_string(
i->get_location().wml_x()) +
"," + std::to_string(
i->get_location().wml_y()) +
")");
83 ERR_AI <<
"formula type error while evaluating unit priority formula " <<
e.message;
98 if (
i->formula_manager().has_formula()) {
106 WRN_AI <<
"unit formula skipped, maybe it's empty or incorrect";
110 if(
e.filename ==
"formula") {
113 fai_.
handle_exception(
e,
"Unit formula error for unit: '" +
i->type_id() +
"' standing at (" + std::to_string(
i->get_location().wml_x()) +
"," + std::to_string(
i->get_location().wml_y()) +
")");
119 if (
i->formula_manager().has_loop_formula())
130 WRN_AI <<
"Loop formula skipped, maybe it's empty or incorrect";
133 if (
e.filename ==
"formula") {
136 fai_.
handle_exception(
e,
"Unit loop formula error for unit: '" +
i->type_id() +
"' standing at (" + std::to_string(
i->get_location().wml_x()) +
"," + std::to_string(
i->get_location().wml_y()) +
")");
virtual side_number get_side() const override
Get the side number.
virtual config to_config() const
serialize
A config object defines a single node in a WML file, with access to child nodes.
virtual const unit_map & units() const override
Container associating units to locations.
Standard logging facilities (interface).
A small explanation about what's going on here: Each action has access to two game_info objects First...
std::string::const_iterator iterator
std::shared_ptr< const formula > const_formula_ptr
std::multiset< unit_formula_pair, unit_formula_compare > unit_formula_set
std::pair< unit_map::unit_iterator, int > unit_formula_pair