AI/Game Info: formatting/forward declaration cleanup

(cherry-picked from commit 1af08fb58e)
This commit is contained in:
Charles Dang 2018-04-29 05:25:36 +11:00
parent aba6378d06
commit 3028af890c

View file

@ -20,62 +20,54 @@
#pragma once
#include "map/location.hpp"
namespace pathfind {
struct paths;
}
#include <map>
#include <memory>
namespace pathfind
{
struct paths;
}
/**
* info is structure which holds references to all the important objects
* that an AI might need access to, in order to make and implement its
* decisions.
*/
namespace ai {
namespace ai
{
typedef int side_number;
/** The standard way in which a map of possible moves is recorded. */
typedef std::multimap<map_location,map_location> move_map;
typedef std::multimap<map_location, map_location> move_map;
/** The standard way in which a map of possible movement routes to location is recorded*/
typedef std::map<map_location,pathfind::paths> moves_map;
typedef std::map<map_location, pathfind::paths> moves_map;
class ai_composite;
typedef std::shared_ptr<ai_composite> ai_ptr;
class attack_analysis;
typedef std::vector<attack_analysis> attacks_vector;
class readonly_context;
class readwrite_context;
class default_ai_context;
class ai_context;
class aspect;
class candidate_action;
class engine;
class goal;
class known_aspect;
class stage;
template<typename T>
class typesafe_aspect;
template<typename T>
struct aspect_type {
typedef std::shared_ptr< typesafe_aspect<T>> typesafe_ptr;
typedef std::vector< std::shared_ptr< typesafe_aspect<T>> > typesafe_ptr_vector;
struct aspect_type
{
typedef std::shared_ptr<typesafe_aspect<T>> typesafe_ptr;
typedef std::vector<typesafe_ptr> typesafe_ptr_vector;
};
template<typename T>
class typesafe_known_aspect;
template<typename T>
struct known_aspect_type {
typedef std::shared_ptr< typesafe_known_aspect<T>> typesafe_ptr;
typedef std::vector< std::shared_ptr< typesafe_known_aspect<T>> > typesafe_ptr_vector;
struct known_aspect_type
{
typedef std::shared_ptr<typesafe_known_aspect<T>> typesafe_ptr;
typedef std::vector<typesafe_ptr> typesafe_ptr_vector;
};
class action_result;
@ -96,25 +88,33 @@ typedef std::shared_ptr<move_and_attack_result> move_and_attack_result_ptr;
typedef std::shared_ptr<stopunit_result> stopunit_result_ptr;
typedef std::shared_ptr<synced_command_result> synced_command_result_ptr;
typedef std::shared_ptr< aspect > aspect_ptr;
typedef std::shared_ptr< candidate_action > candidate_action_ptr;
typedef std::shared_ptr< engine > engine_ptr;
typedef std::shared_ptr< goal > goal_ptr;
typedef std::shared_ptr< known_aspect > known_aspect_ptr;
typedef std::shared_ptr< stage > stage_ptr;
class aspect;
class candidate_action;
class engine;
class goal;
class known_aspect;
class stage;
typedef std::map<std::string, aspect_ptr > aspect_map;
typedef std::map<std::string, known_aspect_ptr > known_aspect_map;
typedef std::shared_ptr<aspect> aspect_ptr;
typedef std::shared_ptr<candidate_action> candidate_action_ptr;
typedef std::shared_ptr<engine> engine_ptr;
typedef std::shared_ptr<goal> goal_ptr;
typedef std::shared_ptr<known_aspect> known_aspect_ptr;
typedef std::shared_ptr<stage> stage_ptr;
class game_info {
typedef std::map<std::string, aspect_ptr> aspect_map;
typedef std::map<std::string, known_aspect_ptr> known_aspect_map;
class game_info
{
public:
game_info()
: recent_attacks()
{
}
game_info()
: recent_attacks()
{}
/** hack. @todo 1.9 rework that via extended event system, or at least ensure it hurts no one */
std::set<map_location> recent_attacks;
/** hack. @todo 1.9 rework that via extended event system, or at least ensure it hurts no one */
std::set<map_location> recent_attacks;
};
} //of namespace ai
} // of namespace ai