From 9396f93f00070aea5babe2515403a11669dd2038 Mon Sep 17 00:00:00 2001 From: Alexander van Gessel Date: Sun, 19 Nov 2017 17:38:03 +0100 Subject: [PATCH] Out-of-line some functions to remove an include --- src/actions/undo_recall_action.cpp | 16 ++++++++++++++++ src/actions/undo_recall_action.hpp | 16 ++-------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/actions/undo_recall_action.cpp b/src/actions/undo_recall_action.cpp index 22fce5ec6e75f..a0bd0d60cdb75 100644 --- a/src/actions/undo_recall_action.cpp +++ b/src/actions/undo_recall_action.cpp @@ -20,6 +20,7 @@ #include "team.hpp" #include "replay.hpp" #include "units/map.hpp" +#include "units/unit.hpp" #include "statistics.hpp" #include "log.hpp" #include "game_display.hpp" @@ -33,6 +34,21 @@ namespace actions namespace undo { +recall_action::recall_action(const unit_const_ptr recalled, const map_location& loc, + const map_location& from, int orig_village_owner, bool time_bonus) + : undo_action() + , shroud_clearing_action(recalled, loc, orig_village_owner, time_bonus) + , id(recalled->id()) + , recall_from(from) +{} + +recall_action::recall_action(const config & cfg, const map_location & from) + : undo_action(cfg) + , shroud_clearing_action(cfg) + , id(cfg["id"]) + , recall_from(from) +{} + /** * Writes this into the provided config. */ diff --git a/src/actions/undo_recall_action.hpp b/src/actions/undo_recall_action.hpp index cf9f97d891b01..f1b52da5f8ea9 100644 --- a/src/actions/undo_recall_action.hpp +++ b/src/actions/undo_recall_action.hpp @@ -16,7 +16,6 @@ #include "undo_action.hpp" #include "shroud_clearing_action.hpp" #include "units/ptr.hpp" -#include "units/unit.hpp" namespace actions { @@ -31,19 +30,8 @@ struct recall_action : undo_action, shroud_clearing_action recall_action(const unit_const_ptr recalled, const map_location& loc, - const map_location& from, int orig_village_owner, bool time_bonus) - : undo_action() - , shroud_clearing_action(recalled, loc, orig_village_owner, time_bonus) - , id(recalled->id()) - , recall_from(from) - { - } - recall_action(const config & cfg, const map_location & from) - : undo_action(cfg) - , shroud_clearing_action(cfg) - , id(cfg["id"]) - , recall_from(from) - {} + const map_location& from, int orig_village_owner, bool time_bonus); + recall_action(const config & cfg, const map_location & from); virtual const char* get_type() const { return "recall"; } virtual ~recall_action() {}