30 #include <boost/lexical_cast.hpp>
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) {
74 WRN_AI <<
"priority formula skipped, maybe it's empty or incorrect"<< std::endl;
79 fai_.
handle_exception( e,
"Unit priority formula error for unit: '" +
i->type_id() +
"' standing at (" + std::to_string(
i->get_location().x + 1) +
"," + std::to_string(
i->get_location().y + 1) +
")");
84 ERR_AI <<
"formula type error while evaluating unit priority formula " << e.
message << std::endl;
99 if (i->formula_manager().has_formula()) {
108 WRN_AI <<
"unit formula skipped, maybe it's empty or incorrect" << std::endl;
115 fai_.
handle_exception( e,
"Unit formula error for unit: '" + i->type_id() +
"' standing at (" + std::to_string(i->get_location().x + 1) +
"," + std::to_string(i->get_location().y + 1) +
")");
121 if (i->formula_manager().has_loop_formula())
133 WRN_AI <<
"Loop formula skipped, maybe it's empty or incorrect" << std::endl;
139 fai_.
handle_exception( e,
"Unit loop formula error for unit: '" + i->type_id() +
"' standing at (" + std::to_string(i->get_location().x + 1) +
"," + std::to_string(i->get_location().y + 1) +
")");
virtual side_number get_side() const
Get the side number.
static const struct @12 priority[]
A small explanation about what's going on here: Each action has access to two game_info objects First...
virtual config to_config() const
serialize
std::pair< unit_map::unit_iterator, int > unit_formula_pair
boost::shared_ptr< std::vector< unit_const_ptr > > units_
std::multiset< unit_formula_pair, game_logic::unit_formula_compare > unit_formula_set
Standard logging facilities (interface).
Container associating units to locations.
A config object defines a single node in a WML file, with access to child nodes.