Skip to content

Commit

Permalink
Out-of-line a function to remove an include
Browse files Browse the repository at this point in the history
  • Loading branch information
AI0867 authored and GregoryLundberg committed Nov 30, 2017
1 parent aefdec1 commit ec3e805
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
12 changes: 12 additions & 0 deletions src/actions/undo_move_action.cpp
Expand Up @@ -21,6 +21,7 @@
#include "log.hpp"
#include "game_display.hpp"
#include "units/udisplay.hpp"
#include "units/unit.hpp"
#include "game_board.hpp"
#include "map/map.hpp"

Expand All @@ -33,6 +34,17 @@ namespace actions
namespace undo
{

move_action::move_action(const unit_const_ptr moved,
const std::vector<map_location>::const_iterator & begin,
const std::vector<map_location>::const_iterator & end,
int sm, int timebonus, int orig, const map_location::DIRECTION dir)
: undo_action()
, shroud_clearing_action(moved, begin, end, orig, timebonus != 0)
, starting_moves(sm)
, starting_dir(dir == map_location::NDIRECTIONS ? moved->facing() : dir)
, goto_hex(moved->get_goto())
{
}

/**
* Writes this into the provided config.
Expand Down
10 changes: 1 addition & 9 deletions src/actions/undo_move_action.hpp
Expand Up @@ -16,7 +16,6 @@
#include "undo_action.hpp"
#include "shroud_clearing_action.hpp"
#include "units/ptr.hpp"
#include "units/unit.hpp"

namespace actions
{
Expand All @@ -33,14 +32,7 @@ struct move_action : undo_action, shroud_clearing_action
move_action(const unit_const_ptr moved,
const std::vector<map_location>::const_iterator & begin,
const std::vector<map_location>::const_iterator & end,
int sm, int timebonus, int orig, const map_location::DIRECTION dir)
: undo_action()
, shroud_clearing_action(moved, begin, end, orig, timebonus != 0)
, starting_moves(sm)
, starting_dir(dir == map_location::NDIRECTIONS ? moved->facing() : dir)
, goto_hex(moved->get_goto())
{
}
int sm, int timebonus, int orig, const map_location::DIRECTION dir);
move_action(const config & cfg, const config & unit_cfg,
int sm, const map_location::DIRECTION dir)
: undo_action(cfg)
Expand Down

0 comments on commit ec3e805

Please sign in to comment.