ai/game_info.hpp

Go to the documentation of this file.
00001 /* $Id: game_info.hpp 52533 2012-01-07 02:35:17Z shadowmaster $ */
00002 /*
00003    Copyright (C) 2003 - 2012 by David White <dave@whitevine.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  * @file
00018  * Game information for the AI
00019  */
00020 
00021 #ifndef AI_GAME_INFO_HPP_INCLUDED
00022 #define AI_GAME_INFO_HPP_INCLUDED
00023 
00024 #include <boost/shared_ptr.hpp>
00025 #include "../map_location.hpp"
00026 namespace pathfind {
00027     struct paths;
00028 }
00029 
00030 #include <map>
00031 
00032 class game_display;
00033 class game_state;
00034 class gamemap;
00035 class unit_map;
00036 class team;
00037 class tod_manager;
00038 
00039 /**
00040  * info is structure which holds references to all the important objects
00041  * that an AI might need access to, in order to make and implement its
00042  * decisions.
00043  */
00044 namespace ai {
00045 
00046 typedef int side_number;
00047 
00048 /** The standard way in which a map of possible moves is recorded. */
00049 typedef std::multimap<map_location,map_location> move_map;
00050 
00051 /** The standard way in which a map of possible movement routes to location is recorded*/
00052 typedef std::map<map_location,pathfind::paths> moves_map;
00053 
00054 class interface;
00055 
00056 typedef boost::shared_ptr< interface > ai_ptr;
00057 
00058 class attack_analysis;
00059 typedef std::vector<attack_analysis> attacks_vector;
00060 
00061 class readonly_context;
00062 class readwrite_context;
00063 class default_ai_context;
00064 class ai_context;
00065 
00066 class aspect;
00067 class candidate_action;
00068 class engine;
00069 class goal;
00070 class known_aspect;
00071 class ministage;
00072 class stage;
00073 
00074 template<typename T>
00075 class typesafe_aspect;
00076 
00077 template<typename T>
00078 struct aspect_type {
00079     typedef boost::shared_ptr< typesafe_aspect<T> > typesafe_ptr;
00080     typedef std::vector< boost::shared_ptr< typesafe_aspect<T> > > typesafe_ptr_vector;
00081 };
00082 
00083 template<typename T>
00084 class typesafe_known_aspect;
00085 
00086 template<typename T>
00087 struct known_aspect_type {
00088     typedef boost::shared_ptr< typesafe_known_aspect<T> > typesafe_ptr;
00089     typedef std::vector< boost::shared_ptr< typesafe_known_aspect<T> > > typesafe_ptr_vector;
00090 };
00091 
00092 class action_result;
00093 class attack_result;
00094 class recall_result;
00095 class recruit_result;
00096 class move_result;
00097 class move_and_attack_result;
00098 class stopunit_result;
00099 
00100 typedef boost::shared_ptr<action_result> action_result_ptr;
00101 typedef boost::shared_ptr<attack_result> attack_result_ptr;
00102 typedef boost::shared_ptr<recall_result> recall_result_ptr;
00103 typedef boost::shared_ptr<recruit_result> recruit_result_ptr;
00104 typedef boost::shared_ptr<move_result> move_result_ptr;
00105 typedef boost::shared_ptr<move_and_attack_result> move_and_attack_result_ptr;
00106 typedef boost::shared_ptr<stopunit_result> stopunit_result_ptr;
00107 
00108 typedef boost::shared_ptr< aspect > aspect_ptr;
00109 typedef boost::shared_ptr< candidate_action > candidate_action_ptr;
00110 typedef boost::shared_ptr< engine > engine_ptr;
00111 typedef boost::shared_ptr< goal > goal_ptr;
00112 typedef boost::shared_ptr< known_aspect > known_aspect_ptr;
00113 typedef boost::shared_ptr< ministage > ministage_ptr;
00114 typedef boost::shared_ptr< stage > stage_ptr;
00115 
00116 typedef std::map<std::string, aspect_ptr > aspect_map;
00117 typedef std::map<std::string, known_aspect_ptr > known_aspect_map;
00118 
00119 class game_info {
00120 public:
00121 
00122         game_info()
00123             : recent_attacks()
00124         {}
00125 
00126         /** hack. @todo 1.9 rework that via extended event system, or at least ensure it hurts no one */
00127         std::set<map_location> recent_attacks;
00128 };
00129 
00130 } //of namespace ai
00131 
00132 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:02:44 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs