12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #ifndef GAME_H
- #define GAME_H
- #include <array>
- #include "String.h"
- #include "Types.h"
- #include "Vector.h"
- #include "List.h"
- #include "Fields.h"
- class Game final {
- public:
- Game();
- void readLine();
- private:
- bool parseLine(const String& command);
- bool isInRange(const Vector& v) const;
- bool areNeighbors(const Vector& from, const Vector& to) const;
- uint removeLine(const Vector& from, const Vector& to, Fields::State state);
- uint getRank(const Vector& from, const Vector& to, Fields::State state) const;
- uint getStoneTakes(const Vector& from, const Vector& to) const;
- uint getStoneFreedom(const Vector& from, Fields::State state) const;
- uint getFreedom(Fields::State state) const;
- uint 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;
- bool isTakingPossible() const;
- uint getBestEnemyRank() const;
- Fields fields;
- Vector active;
- Vector direction;
- bool mustTake;
- List<Vector, 20> lastLocations;
- static std::array<Vector, 8> neighbours;
- static std::array<Vector, 9 * 5> fieldVectors;
-
- static long int getNanos();
- static long int selectionTime;
- static long int moveTime;
- static int turns;
- static int moves;
- };
- #endif
|