diff options
author | Justin Worthe <justin.worthe@gmail.com> | 2015-06-03 23:03:40 +0200 |
---|---|---|
committer | Justin Worthe <justin.worthe@gmail.com> | 2015-06-03 23:03:40 +0200 |
commit | 140b51f2bcd9c0aaa5b536d85702064a93530188 (patch) | |
tree | 5635713a49790726e2f99853f2feb38cd7bea578 /src/move_string_mapper.cpp | |
parent | a197a92893cff416b63da359db8c8059c7f333bf (diff) |
Moved mapping move to string to its own file
Diffstat (limited to 'src/move_string_mapper.cpp')
-rw-r--r-- | src/move_string_mapper.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/move_string_mapper.cpp b/src/move_string_mapper.cpp new file mode 100644 index 0000000..37d5d7e --- /dev/null +++ b/src/move_string_mapper.cpp @@ -0,0 +1,21 @@ +#include "move_string_mapper.h" + +#include "move.h" +#include <map> +#include <string> + +MoveStringMapper::MoveStringMapper() +{ + moveMap[Move::NOTHING] = "Nothing"; + moveMap[Move::MOVE_LEFT] = "MoveLeft"; + moveMap[Move::MOVE_RIGHT] = "MoveRight"; + moveMap[Move::SHOOT] = "Shoot"; + moveMap[Move::BUILD_ALIEN_FACTORY] = "BuildAlienFactory"; + moveMap[Move::BUILD_MISSILE_CONTROLLER] = "BuildMissileController"; + moveMap[Move::BUILD_SHIELD] = "BuildShield"; +} + +std::string MoveStringMapper::toString(const Move &move) +{ + return moveMap[move]; +} |