#ifndef GAME_H #define GAME_H #include #include "String.h" #include "Types.h" #include "Vector.h" class Game final { public: enum FieldState { BLACK, WHITE, EMPTY }; Game(); void parse(); private: void consumeLine() const; void consumeLine(uint y); void parseFields(); bool isInRange(const Vector& v) const; void print(String& s) const; void printLine(String& s, int y) const; bool areNeighbours(const Vector& from, const Vector& to) const; void addLocation(const Vector& v); bool isInQueue(const Vector& v) const; void removeLine(const Vector& from, const Vector& to, FieldState state); uint getRank(const Vector& from, const Vector& to, FieldState state) const; uint getStoneTakes(const Vector& from, const Vector& to) const; uint getStoneFreedom(const Vector& from) const; uint getFreedom(FieldState state) const; bool hasState(const Vector& v, FieldState state) const; FieldState getState(const Vector& v) const; void setState(const Vector& v, FieldState state); void move(const Vector& from, const Vector& to); void makeSelection(); void makeMove(); void takeStone(); int getQuality(const Vector& from, const Vector& to) const; int countBlack() const; FieldState fields[9][5]; Vector active; Vector direction; std::array lastLocations; uint lastLocation; static std::array neighbours; static std::array fieldVectors; }; #endif