Skip to content

Commit

Permalink
Out-of-line some functions to remove an include
Browse files Browse the repository at this point in the history
  • Loading branch information
AI0867 committed Nov 19, 2017
1 parent d9fe639 commit ba33ed7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
16 changes: 16 additions & 0 deletions src/actions/undo_recruit_action.cpp
Expand Up @@ -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"
Expand All @@ -33,6 +34,21 @@ namespace actions
namespace undo
{

recruit_action::recruit_action(const unit_const_ptr recruited, const map_location& loc,
const map_location& from, int orig_village_owner, bool time_bonus)
: undo_action()
, shroud_clearing_action(recruited, loc, orig_village_owner, time_bonus)
, u_type(recruited->type())
, recruit_from(from)
{}

recruit_action::recruit_action(const config & cfg, const unit_type & type, const map_location& from)
: undo_action(cfg)
, shroud_clearing_action(cfg)
, u_type(type)
, recruit_from(from)
{}

/**
* Writes this into the provided config.
*/
Expand Down
17 changes: 3 additions & 14 deletions src/actions/undo_recruit_action.hpp
Expand Up @@ -16,7 +16,7 @@
#include "undo_action.hpp"
#include "shroud_clearing_action.hpp"
#include "units/ptr.hpp"
#include "units/unit.hpp"
#include "units/types.hpp"

namespace actions
{
Expand All @@ -30,19 +30,8 @@ struct recruit_action : undo_action, shroud_clearing_action


recruit_action(const unit_const_ptr recruited, const map_location& loc,
const map_location& from, int orig_village_owner, bool time_bonus)
: undo_action()
, shroud_clearing_action(recruited, loc, orig_village_owner, time_bonus)
, u_type(recruited->type())
, recruit_from(from)
{
}
recruit_action(const config & cfg, const unit_type & type, const map_location& from)
: undo_action(cfg)
, shroud_clearing_action(cfg)
, u_type(type)
, recruit_from(from)
{}
const map_location& from, int orig_village_owner, bool time_bonus);
recruit_action(const config & cfg, const unit_type & type, const map_location& from);
virtual const char* get_type() const { return "recruit"; }
virtual ~recruit_action() {}

Expand Down

0 comments on commit ba33ed7

Please sign in to comment.