From 8eebf1079fbed2848ee47cf990f5def5926a0c1f Mon Sep 17 00:00:00 2001 From: Justin Wernick Date: Tue, 19 Apr 2022 21:24:15 +0200 Subject: Refile for merging repos --- 2015-spacebot/src/move_string_mapper.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 2015-spacebot/src/move_string_mapper.cpp (limited to '2015-spacebot/src/move_string_mapper.cpp') diff --git a/2015-spacebot/src/move_string_mapper.cpp b/2015-spacebot/src/move_string_mapper.cpp new file mode 100644 index 0000000..ed510c1 --- /dev/null +++ b/2015-spacebot/src/move_string_mapper.cpp @@ -0,0 +1,21 @@ +#include "move_string_mapper.h" + +#include "move.h" +#include +#include + +MoveStringMapper::MoveStringMapper() +{ + moveMap[Move::NOTHING] = "Nothing"; + moveMap[Move::MOVE_LEFT] = "MoveLeft"; + moveMap[Move::MOVE_RIGHT] = "MoveRight"; + moveMap[Move::SHOOT] = "Shoot"; + moveMap[Move::BUILD_MISSILE_CONTROLLER] = "BuildMissileController"; + moveMap[Move::BUILD_ALIEN_FACTORY] = "BuildAlienFactory"; + moveMap[Move::BUILD_SHIELD] = "BuildShield"; +} + +std::string MoveStringMapper::toString(const Move &move) +{ + return moveMap[move]; +} -- cgit v1.2.3