Skip to content

Commit

Permalink
move default relative dir mode to .cpp file, for ease of testing
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeck88 committed May 19, 2014
1 parent de4caa8 commit 748ba75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/map_location.cpp
Expand Up @@ -176,6 +176,11 @@ map_location map_location::get_direction(
}
}

map_location::DIRECTION map_location::get_relative_dir(const map_location & loc) const
{
return get_relative_dir(loc, map_location::DEFAULT);
}

map_location::DIRECTION map_location::get_relative_dir(const map_location & loc, map_location::RELATIVE_DIR_MODE opt) const
{
if (opt == map_location::DEFAULT) {
Expand Down
3 changes: 2 additions & 1 deletion src/map_location.hpp
Expand Up @@ -96,7 +96,8 @@ struct map_location {
map_location get_direction(DIRECTION d, int n = 1) const;

enum RELATIVE_DIR_MODE { DEFAULT , RADIAL_SYMMETRY };
DIRECTION get_relative_dir(const map_location & loc, map_location::RELATIVE_DIR_MODE mode = map_location::DEFAULT ) const;
DIRECTION get_relative_dir(const map_location & loc, map_location::RELATIVE_DIR_MODE mode /*= map_location::RADIAL_SYMMETRY*/ ) const;
DIRECTION get_relative_dir(const map_location & loc) const; //moved the default setting to .cpp file for ease of testing

// Express as a vector in the basis N, NE. N, and NE may be obtained by zero.get_direction(NORTH), ...(NORTH_EAST), respectively.
std::pair<int,int> get_in_basis_N_NE() const;
Expand Down

0 comments on commit 748ba75

Please sign in to comment.