Game Events: include cleanup

* Removed a ton of unnecessary includes
* Moved handler type aliases to fwd.hpp
* Added copyright notice to fwd.hpp
This commit is contained in:
Charles Dang 2017-12-01 14:52:39 +11:00
parent daec3eb945
commit 35e5cdf291
11 changed files with 27 additions and 36 deletions

View file

@ -1,8 +1,29 @@
/*
Copyright (C) 2017 by the Battle for Wesnoth Project http://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/
#pragma once
#include <list>
#include <memory>
#include <tuple>
namespace game_events
{
using pump_result_t = std::tuple<bool /* undo_disabled*/, bool /* action_aborted */>;
class event_handler;
using handler_ptr = std::shared_ptr<event_handler>;
using weak_handler_ptr = std::weak_ptr<event_handler>;
using handler_list = std::list<weak_handler_ptr>;
using pump_result_t = std::tuple<bool /* undo_disabled*/, bool /* action_aborted */>;
}

View file

@ -19,18 +19,14 @@
*/
#include "game_events/handlers.hpp"
#include "game_events/manager_impl.hpp"
#include "game_events/menu_item.hpp"
#include "game_events/pump.hpp"
#include "formula/string_utils.hpp"
#include "game_data.hpp"
#include "log.hpp"
#include "reports.hpp"
#include "scripting/game_lua_kernel.hpp"
#include "serialization/string_utils.hpp"
#include "sound.hpp"
#include "soundsource.hpp"
#include "variable.hpp"
#include <iostream>

View file

@ -25,9 +25,6 @@
#include "config.hpp"
#include <list>
#include <memory>
#include <set>
#include <string>
class game_data;
@ -36,12 +33,6 @@ class game_lua_kernel;
namespace game_events
{
struct queued_event;
class event_handler; // Defined a few lines down.
class manager;
using handler_ptr = std::shared_ptr<event_handler>;
using weak_handler_ptr = std::weak_ptr<event_handler>;
using handler_list = std::list<weak_handler_ptr>;
class event_handler
{

View file

@ -19,15 +19,9 @@
#include "game_events/menu_item.hpp"
#include "game_events/pump.hpp"
#include "filter_context.hpp"
#include "formula/string_utils.hpp"
#include "game_data.hpp"
#include "log.hpp"
#include "reports.hpp"
#include "resources.hpp"
#include "scripting/game_lua_kernel.hpp"
#include "serialization/string_utils.hpp"
#include "soundsource.hpp"
#include <iostream>

View file

@ -14,8 +14,9 @@
#pragma once
#include "game_events/handlers.hpp"
#include "game_events/fwd.hpp"
#include "game_events/wmi_manager.hpp"
#include "config.hpp"
#include <functional>
#include <set>

View file

@ -15,14 +15,8 @@
#include "game_events/manager_impl.hpp"
#include "game_events/handlers.hpp"
#include "game_events/menu_item.hpp"
#include "game_events/pump.hpp"
#include "formula/string_utils.hpp"
#include "game_data.hpp"
#include "log.hpp"
#include "reports.hpp"
#include "scripting/game_lua_kernel.hpp"
#include "serialization/string_utils.hpp"
#include <boost/algorithm/string.hpp>

View file

@ -14,9 +14,9 @@
#pragma once
#include "game_events/handlers.hpp"
#include "game_events/fwd.hpp"
#include "config.hpp"
#include <memory>
#include <unordered_map>
namespace game_events

View file

@ -24,10 +24,8 @@
#include "game_events/pump.hpp"
#include "game_config.hpp"
#include "game_data.hpp"
#include "hotkey/hotkey_handler.hpp"
#include "log.hpp"
#include "play_controller.hpp"
#include "replay_helper.hpp"
#include "resources.hpp"
#include "synced_context.hpp"

View file

@ -24,8 +24,6 @@
#include "display_chat_manager.hpp"
#include "game_config.hpp"
#include "game_data.hpp"
#include "game_display.hpp"
#include "gettext.hpp"
#include "log.hpp"
#include "play_controller.hpp"

View file

@ -29,7 +29,6 @@
#include "game_events/fwd.hpp"
#include "game_events/entity_location.hpp"
#include "game_events/handlers.hpp"
#include "game_events/manager.hpp"
#include "config.hpp"

View file

@ -18,7 +18,6 @@
*/
#include "game_events/wmi_manager.hpp"
#include "game_events/handlers.hpp"
#include "game_events/menu_item.hpp"
#include "play_controller.hpp"
#include "resources.hpp"