#include "spacebot.h" #include "move_string_mapper.h" #include #include #include Spacebot::Spacebot(std::string outputPath) : outputFilename(outputPath+"/move.txt"), gameState(outputPath+"/map.txt") { } void Spacebot::writeNextMove() { Move move = chooseMove(); writeMove(move); } Move Spacebot::chooseMove() { int min = static_cast(Move::NOTHING); int max = static_cast(Move::BUILD_SHIELD); std::random_device rd; std::mt19937 gen(rd()); std::uniform_int_distribution dis(min, max); return static_cast(dis(gen)); } void Spacebot::writeMove(const Move& move) { std::ofstream resultStream(outputFilename); resultStream << MoveStringMapper().toString(move) << std::endl; return; }