Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef AI_TESTING_ASPECT_ATTACKS_HPP_INCLUDED
00022 #define AI_TESTING_ASPECT_ATTACKS_HPP_INCLUDED
00023
00024 #include "../composite/aspect.hpp"
00025 #include "../interface.hpp"
00026
00027 #ifdef _MSC_VER
00028 #pragma warning(push)
00029
00030 #pragma warning(disable:4250)
00031 #endif
00032
00033 namespace ai {
00034
00035
00036 namespace testing_ai_default {
00037
00038 class aspect_attacks: public typesafe_aspect<attacks_vector> {
00039 public:
00040 aspect_attacks(readonly_context &context, const config &cfg, const std::string &id);
00041
00042
00043 virtual ~aspect_attacks();
00044
00045
00046 virtual void recalculate() const;
00047
00048
00049 virtual config to_config() const;
00050
00051
00052 protected:
00053 boost::shared_ptr<attacks_vector> analyze_targets() const;
00054
00055 void do_attack_analysis(const map_location& loc,
00056 const move_map& srcdst, const move_map& dstsrc,
00057 const move_map& fullmove_srcdst, const move_map& fullmove_dstsrc,
00058 const move_map& enemy_srcdst, const move_map& enemy_dstsrc,
00059 const map_location* tiles, bool* used_locations,
00060 std::vector<map_location>& units,
00061 std::vector<attack_analysis>& result,
00062 attack_analysis& cur_analysis,
00063 const team ¤t_team) const;
00064 static int rate_terrain(const unit& u, const map_location& loc);
00065 config filter_own_;
00066 config filter_enemy_;
00067 };
00068
00069
00070
00071 }
00072
00073 }
00074
00075 #ifdef _MSC_VER
00076 #pragma warning(pop)
00077 #endif
00078
00079 #endif