diff --git a/src/ai/contexts.cpp b/src/ai/contexts.cpp index f649776cdb7e..bcd6d9a984e5 100644 --- a/src/ai/contexts.cpp +++ b/src/ai/contexts.cpp @@ -18,31 +18,53 @@ * @file */ -#include "actions.hpp" -#include "contexts.hpp" -#include "manager.hpp" - -#include "composite/aspect.hpp" -#include "composite/engine.hpp" -#include "composite/goal.hpp" - -#include "default/ai.hpp" - -#include "../actions/attack.hpp" -#include "../formula.hpp" -#include "../formula_function.hpp" -#include "../formula_fwd.hpp" -#include "../game_board.hpp" -#include "../game_display.hpp" -#include "../log.hpp" -#include "../map.hpp" -#include "../mouse_handler_base.hpp" -#include "../recall_list_manager.hpp" -#include "../resources.hpp" -#include "../tod_manager.hpp" -#include "../unit.hpp" - -#include +#include "ai/contexts.hpp" + +#include "global.hpp" + +#include "actions/attack.hpp" + +#include "ai/actions.hpp" // for actions +#include "ai/composite/aspect.hpp" // for typesafe_aspect, aspect, etc +#include "ai/composite/engine.hpp" // for engine, engine_factory, etc +#include "ai/composite/goal.hpp" // for goal +#include "ai/composite/stage.hpp" // for ministage +#include "ai/game_info.hpp" // for aspect_type<>::typesafe_ptr, etc +#include "ai/lua/unit_advancements_aspect.hpp" +#include "ai/manager.hpp" // for manager + +#include "chat_events.hpp" // for chat_handler, etc +#include "config.hpp" // for config, etc +#include "game_board.hpp" // for game_board +#include "game_config.hpp" // for debug +#include "game_display.hpp" // for game_display +#include "game_errors.hpp" // for throw +#include "log.hpp" // for LOG_STREAM, logger, etc +#include "map.hpp" // for gamemap +#include "pathfind/pathfind.hpp" // for paths::dest_vect, paths, etc +#include "recall_list_manager.hpp" // for recall_list_manager +#include "resources.hpp" // for units, gameboard, etc +#include "serialization/string_utils.hpp" // for split, etc +#include "team.hpp" // for team +#include "terrain_filter.hpp" // for terrain_filter +#include "terrain_translation.hpp" // for t_terrain +#include "time_of_day.hpp" // for time_of_day +#include "tod_manager.hpp" // for tod_manager +#include "unit.hpp" // for unit, intrusive_ptr_release, etc +#include "unit_map.hpp" // for unit_map::iterator_base, etc +#include "unit_ptr.hpp" // for UnitPtr +#include "unit_types.hpp" // for attack_type, unit_type, etc +#include "variant.hpp" // for variant + +#include // for find, count, max +#include // for auto_any_base, etc +#include // for intrusive_ptr +#include // for dynamic_pointer_cast, etc +#include // for sqrt +#include // for NULL, abs +#include // for time +#include // for back_inserter +#include // for operator<<, basic_ostream, etc static lg::log_domain log_ai("ai/general"); #define DBG_AI LOG_STREAM(debug, log_ai) diff --git a/src/ai/contexts.hpp b/src/ai/contexts.hpp index c36f7a157274..afc8afa6cb72 100644 --- a/src/ai/contexts.hpp +++ b/src/ai/contexts.hpp @@ -21,13 +21,35 @@ #ifndef AI_CONTEXTS_HPP_INCLUDED #define AI_CONTEXTS_HPP_INCLUDED -#include "game_info.hpp" -#include "../generic_event.hpp" -#include "../config.hpp" -#include "lua/unit_advancements_aspect.hpp" -#include "../unit_ptr.hpp" - -//#include "../unit.hpp" +#include "ai/game_info.hpp" // for move_map, aspect_type, etc + +#include "global.hpp" + +#include "../config.hpp" // for config +#include "../game_errors.hpp" +#include "../generic_event.hpp" // for observer +#include "../unit_ptr.hpp" // for UnitPtr +#include "../map_location.hpp" // for map_location + +#include // for map, map<>::value_compare +#include // for set +#include // for string +#include // for pair +#include // for vector + +class gamemap; // lines 41-41 +class team; +class terrain_filter; // lines 43-43 +class unit_map; +class unit_type; // lines 46-46 +class variant; // lines 42-42 +namespace ai { class ai_context; } // lines 51-51 +namespace ai { class ministage; } +namespace ai { class unit_advancements_aspect; } +namespace ai { template class typesafe_aspect; } +namespace boost { template class shared_ptr; } +namespace pathfind { struct paths; } +struct battle_context_unit_stats; // lines 39-39 #ifdef _MSC_VER #pragma warning(push) @@ -35,21 +57,8 @@ #pragma warning(disable:4250) #endif -class battle_context; -struct battle_context_unit_stats; -class game_display; -class gamemap; -class variant; -class terrain_filter; -class terrain_translation; -class unit; -class unit_type; - namespace ai { -class interface; -class ai_context; - typedef ai_context* ai_context_ptr; diff --git a/src/ai/recruitment/recruitment.hpp b/src/ai/recruitment/recruitment.hpp index 175c18a87ac6..18c9a0cd137b 100644 --- a/src/ai/recruitment/recruitment.hpp +++ b/src/ai/recruitment/recruitment.hpp @@ -23,6 +23,7 @@ #include "../composite/rca.hpp" #include "../../unit.hpp" +#include "../../unit_map.hpp" #include #include diff --git a/src/config.cpp b/src/config.cpp index 5aa27086d693..821328d1dbce 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -18,20 +18,24 @@ * Routines related to configuration-files / WML. */ +#include "config.hpp" + #include "global.hpp" -#include "config.hpp" #include "log.hpp" -#include "serialization/string_utils.hpp" #include "util.hpp" #include "utils/const_clone.tpp" #include #include #include +#include #include -#include +#include +#include +#include +#include static lg::log_domain log_config("config"); #define ERR_CF LOG_STREAM(err, log_config) diff --git a/src/config.hpp b/src/config.hpp index 54ac0fa43f39..b92d2d7b3c88 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -30,23 +30,22 @@ #include "global.hpp" -#include +#include #include +#include +#include +#include +#include #include +#include #include -#include -#include -#include #include -#include "game_errors.hpp" +#include "exceptions.hpp" #include "tstring.hpp" class config; -struct tconfig_implementation; -class vconfig; -struct lua_State; bool operator==(const config &, const config &); inline bool operator!=(const config &a, const config &b) { return !operator==(a, b); } diff --git a/src/game_events/action_wml.cpp b/src/game_events/action_wml.cpp index 73f2a58e6385..a8f299697089 100644 --- a/src/game_events/action_wml.cpp +++ b/src/game_events/action_wml.cpp @@ -34,6 +34,7 @@ #include "../fake_unit_ptr.hpp" #include "../game_classification.hpp" #include "../game_display.hpp" +#include "../game_errors.hpp" #include "../game_preferences.hpp" #include "../gettext.hpp" #include "../gui/dialogs/gamestate_inspector.hpp" diff --git a/src/image_modifications.hpp b/src/image_modifications.hpp index afed625392cf..4cd0f0749273 100644 --- a/src/image_modifications.hpp +++ b/src/image_modifications.hpp @@ -17,6 +17,7 @@ #ifndef IMAGE_MODIFICATIONS_HPP_INCLUDED #define IMAGE_MODIFICATIONS_HPP_INCLUDED +#include "lua_jailbreak_exception.hpp" #include "sdl/utils.hpp" #include diff --git a/src/playcampaign.cpp b/src/playcampaign.cpp index a5d6ba93d024..d5fb25a9f418 100644 --- a/src/playcampaign.cpp +++ b/src/playcampaign.cpp @@ -23,6 +23,7 @@ #include "playcampaign.hpp" #include "carryover.hpp" +#include "game_errors.hpp" #include "game_preferences.hpp" #include "generators/map_create.hpp" #include "gui/dialogs/message.hpp" diff --git a/src/preferences_display.cpp b/src/preferences_display.cpp index f8df7ac5118e..b9e10793c0db 100644 --- a/src/preferences_display.cpp +++ b/src/preferences_display.cpp @@ -168,7 +168,7 @@ bool set_resolution(CVideo& video { SDL_Rect rect; SDL_GetClipRect(video.getSurface(), &rect); - if(rect.w == width && rect.h == height) { + if(static_cast (rect.w) == width && static_cast(rect.h) == height) { return true; } diff --git a/src/replay_controller.cpp b/src/replay_controller.cpp index 91eea1ecb9f0..b088599527c5 100644 --- a/src/replay_controller.cpp +++ b/src/replay_controller.cpp @@ -20,6 +20,7 @@ #include "carryover.hpp" #include "actions/vision.hpp" #include "game_end_exceptions.hpp" +#include "game_errors.hpp" //needed to be thrown #include "game_events/handlers.hpp" #include "gettext.hpp" #include "log.hpp" diff --git a/src/unit_types.cpp b/src/unit_types.cpp index f15f4f5ab5fb..9b34856088f2 100644 --- a/src/unit_types.cpp +++ b/src/unit_types.cpp @@ -22,6 +22,7 @@ #include "unit_types.hpp" #include "game_config.hpp" +#include "game_errors.hpp" //thrown sometimes //#include "gettext.hpp" #include "loadscreen.hpp" #include "log.hpp"