ai/testing/aspect_attacks.hpp

Go to the documentation of this file.
00001 /* $Id: aspect_attacks.hpp 53754 2012-04-02 18:07:01Z crab $ */
00002 /*
00003    Copyright (C) 2009 - 2012 by Yurii Chernyi <terraninfo@terraninfo.net>
00004    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY.
00012 
00013    See the COPYING file for more details.
00014 */
00015 
00016 /**
00017  * Aspect: attacks
00018  * @file
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 //silence "inherits via dominance" warnings
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 &current_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 } // end of namespace testing_ai_default
00072 
00073 } // end of namespace ai
00074 
00075 #ifdef _MSC_VER
00076 #pragma warning(pop)
00077 #endif
00078 
00079 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Wed May 23 2012 01:02:32 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs