#ifndef GAME_H #define GAME_H #include #include "String.h" #include "Types.h" class Game final { public: enum FieldState { BLACK, WHITE, EMPTY }; enum State { SELECTION, MOVE, ANOTHER_MOVE }; Game(); void reset(String& output); void parse(const String& input, String& output); private: bool parseLocation(const String& input, int& x, int& y); void parseSelection(const String& input, String& output); void parseMove(const String& input, String& output); void parseAnotherMove(const String& input, String& output); void move(int fromX, int fromY, int toX, int toY); bool isDigit(char c) const; bool isInRange(int x, int y) const; void reset(); void print(String& s) const; void printLine(String& s, int index) const; bool removeLine(int x, int y, int x2, int y2, FieldState remove); void revertToSelection(String& output); bool areNeighbours(int x, int y, int x2, int y2) const; void botMove(String& output); void addLocation(int x, int y); bool isInQueue(int x, int y) const; bool canMoveActiveStoneTo(int dirX, int dirY) const; bool isAnotherTurnPossible() const; FieldState fields[9][5]; int activeX; int activeY; int directionX; int directionY; State state; struct Location { int x; int y; }; std::array lastLocations; uint lastLocation; }; #endif