20 #include "formula/callable_objects.hpp"
31 typedef std::multimap<map_location, map_location>
move_map;
74 return variant(std::make_shared<location_callable>(
src_));
75 }
else if(key ==
"dst") {
76 return variant(std::make_shared<location_callable>(
dst_));
103 return variant(std::make_shared<location_callable>(
src_));
104 }
else if(key ==
"dst") {
105 return variant(std::make_shared<location_callable>(
dst_));
141 const std::string&
id()
const {
return id_; }
174 const std::string&
key()
const {
return key_; }
189 typedef std::multimap<map_location, map_location>
move_map;
245 const std::vector<variant>&
prob,
246 const std::vector<variant>&
status)
252 const std::vector<variant>&
prob()
const {
return prob_; }
Various functions that implement attacks and attack calculations.
Computes the statistics of a battle between an attacker and a defender unit.
const battle_context_unit_stats & get_defender_stats() const
This method returns the statistics of the defender.
const battle_context_unit_stats & get_attacker_stats() const
This method returns the statistics of the attacker.
Container associating units to locations.
const map_location & src() const
const map_location & move_from() const
void get_inputs(formula_input_vector &inputs) const override
attack_callable(const map_location &move_from, const map_location &src, const map_location &dst, int weapon)
variant execute_self(variant ctxt) override
const map_location & dst() const
variant get_value(const std::string &key) const override
int do_compare(const formula_callable *callable) const override
Compare two attacks in deterministic way or compare pointers (nondeterministic in consequent game run...
int defender_weapon() const
variant get_value(const std::string &key) const override
const ai::formula_ai & 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(formula_input_vector &inputs) const override
attack_map_callable(const ai::formula_ai &ai, const unit_map &units)
variant execute_self(variant ctxt) override
variant get_value(const std::string &) const override
void get_inputs(formula_input_vector &inputs) const override
const map_location & dst() const
const map_location & src() const
move_callable(const map_location &src, const map_location &dst)
variant execute_self(variant ctxt) override
variant get_value(const std::string &key) const override
int do_compare(const formula_callable *callable) const override
move_map_callable(const move_map &srcdst, const move_map &dstsrc, const unit_map &units)
void get_inputs(formula_input_vector &inputs) const override
variant get_value(const std::string &key) const override
std::multimap< map_location, map_location > move_map
const move_map & dstsrc() const
const move_map & srcdst() const
variant get_value(const std::string &key) const override
void get_inputs(formula_input_vector &inputs) const override
int do_compare(const formula_callable *callable) const override
move_partial_callable(const map_location &src, const map_location &dst)
const map_location & src() const
variant execute_self(variant ctxt) override
const map_location & dst() const
outcome_callable(const std::vector< variant > &hitLeft, const std::vector< variant > &prob, const std::vector< variant > &status)
variant get_value(const std::string &key) const override
const std::vector< variant > & prob() const
const std::vector< variant > & hitLeft() const
std::vector< variant > hitLeft_
std::vector< variant > status_
std::vector< variant > prob_
void get_inputs(formula_input_vector &inputs) const override
const std::vector< variant > & status() const
position_callable(int chance)
void get_inputs(formula_input_vector &inputs) const override
variant get_value(const std::string &key) const override
const map_location & loc() const
void get_inputs(formula_input_vector &inputs) const override
variant execute_self(variant ctxt) override
const std::string & id() const
variant get_value(const std::string &key) const override
recall_callable(const map_location &loc, const std::string &id)
void get_inputs(formula_input_vector &inputs) const override
const std::string & type() const
recruit_callable(const map_location &loc, const std::string &type)
variant execute_self(variant ctxt) override
variant get_value(const std::string &key) const override
const map_location & loc() const
const std::string & key() const
set_unit_var_callable(const std::string &key, const variant &value, const map_location &loc)
void get_inputs(formula_input_vector &inputs) const override
variant execute_self(variant ctxt) override
const map_location loc() const
variant get_value(const std::string &key) const override
Game information for the AI.
A small explanation about what's going on here: Each action has access to two game_info objects First...
std::multimap< map_location, map_location > move_map
The standard way in which a map of possible moves is recorded.
std::vector< formula_input > formula_input_vector
int attack_num
Index into unit->attacks() or -1 for none.
Encapsulates the map of the game.
ai::move_map enemy_dstsrc
ai::move_map enemy_srcdst