15 #ifndef FORMULA_AI_CALLABLE_OBJECTS_HPP_INCLUDED
16 #define FORMULA_AI_CALLABLE_OBJECTS_HPP_INCLUDED
20 #include "formula/callable_objects.hpp"
32 typedef std::multimap<map_location, map_location>
move_map;
76 }
else if(key ==
"dst") {
105 }
else if(key ==
"dst") {
156 : loc_(loc), type_(type)
172 : key_(key), value_(value)
189 : key_(key), value_(value), loc_(loc)
215 , backup_formula_(backup)
239 : failed_callable_(callable), current_unit_location_(loc), status_(status)
245 typedef std::multimap<map_location, map_location>
move_map;
254 : srcdst_(srcdst), dstsrc_(dstsrc), units_(units)
302 const std::vector<variant>&
prob,
303 const std::vector<variant>&
status)
304 : hitLeft_(hitLeft), prob_(prob), status_(status)
309 const std::vector<variant>&
prob()
const {
return prob_; }
const expression_ptr & get_backup() const
variant get_value(const std::string &key) const
outcome_callable(const std::vector< variant > &hitLeft, const std::vector< variant > &prob, const std::vector< variant > &status)
const formula_callable * failed_callable_
const std::string & type() const
variant get_value(const std::string &key) const
variant get_value(const std::string &key) const
variant get_value(const std::string &key) const
ai::move_map enemy_srcdst
int do_compare(const formula_callable *callable) const
variant get_value(const std::string &key) const
Various functions that implement attacks and attack calculations.
GLuint GLuint GLsizei GLenum type
move_map_callable(const move_map &srcdst, const move_map &dstsrc, const unit_map &units)
void get_inputs(std::vector< game_logic::formula_input > *inputs) const
ai::move_map enemy_dstsrc
variant get_value(const std::string &key) const
recruit_callable(const map_location &loc, const std::string &type)
std::vector< variant > prob_
const variant & get_main() const
variant get_value(const std::string &key) const
const std::string & key() const
attack_callable(const map_location &move_from, const map_location &src, const map_location &dst, int weapon)
move_partial_callable(const map_location &src, const map_location &dst)
set_unit_var_callable(const std::string &key, const variant &value, const map_location &loc)
const map_location & dst() const
const map_location & dst() const
attack_map_callable(const ai::formula_ai &ai, const unit_map &units)
const map_location loc() const
safe_call_callable(const variant &main, const expression_ptr &backup)
const std::vector< variant > & prob() const
const ai::formula_ai & ai_
void get_inputs(std::vector< game_logic::formula_input > *inputs) const
std::multimap< map_location, map_location > move_map
The standard way in which a map of possible moves is recorded.
A small explanation about what's going on here: Each action has access to two game_info objects First...
void get_inputs(std::vector< game_logic::formula_input > *inputs) const
void get_inputs(std::vector< game_logic::formula_input > *inputs) const
GLsizei const GLfloat * value
void get_inputs(std::vector< game_logic::formula_input > *inputs) const
const battle_context_unit_stats & get_defender_stats() const
This method returns the statistics of the defender.
Computes the statistics of a battle between an attacker and a defender unit.
expression_ptr backup_formula_
void get_inputs(std::vector< game_logic::formula_input > *inputs) const
int attack_num
Index into unit->attacks() or -1 for none.
void get_inputs(std::vector< game_logic::formula_input > *inputs) const
const map_location & loc() const
const map_location & move_from() const
void get_inputs(std::vector< game_logic::formula_input > *inputs) const
variant get_value(const std::string &key) const
Encapsulates the map of the game.
const map_location & dst() const
recall_callable(const map_location &loc, const std::string &id)
const map_location current_unit_location_
const std::string & id() const
Game information for the AI.
std::multimap< map_location, map_location > move_map
void collect_possible_attacks(std::vector< variant > &vars, map_location attacker_location, map_location attack_position) const
void get_inputs(std::vector< game_logic::formula_input > *inputs) const
variant get_value(const std::string &key) const
void set_backup_result(const variant &v)
variant get_value(const std::string &key) const
int defender_weapon() const
variant get_value(const std::string &) const
int main(int argc, char **argv)
const map_location & src() const
int do_compare(const formula_callable *callable) const
const move_map & dstsrc() const
void get_inputs(std::vector< game_logic::formula_input > *inputs) const
const std::vector< variant > & hitLeft() const
variant get_value(const std::string &key) const
variant get_value(const std::string &key) const
Container associating units to locations.
const std::string & key() const
variant get_value(const std::string &key) const
int do_compare(const game_logic::formula_callable *callable) const
Compare two attacks in deterministic way or compare pointers (nondeterministic in consequent game run...
safe_call_result(const formula_callable *callable, int status, const map_location &loc=map_location())
const battle_context_unit_stats & get_attacker_stats() const
This method returns the statistics of the attacker.
const move_map & srcdst() const
const map_location & src() const
const map_location & loc() const
move_callable(const map_location &src, const map_location &dst)
set_var_callable(const std::string &key, const variant &value)
const map_location & src() const
std::vector< variant > status_
std::multimap< map_location, map_location > move_map
std::vector< variant > hitLeft_
void get_inputs(std::vector< game_logic::formula_input > *inputs) const
void get_inputs(std::vector< game_logic::formula_input > *inputs) const
position_callable(int chance)
GLsizei const GLcharARB ** string
void get_inputs(std::vector< game_logic::formula_input > *inputs) const
const std::vector< variant > & status() const