Game.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef GAME_H
  2. #define GAME_H
  3. #include <array>
  4. #include "String.h"
  5. #include "Types.h"
  6. #include "Vector.h"
  7. #include "List.h"
  8. #include "Fields.h"
  9. class Game final {
  10. public:
  11. Game();
  12. void readLine();
  13. private:
  14. bool parseLine(const String& command);
  15. bool isInRange(const Vector& v) const;
  16. bool areNeighbors(const Vector& from, const Vector& to) const;
  17. uint removeLine(const Vector& from, const Vector& to, Fields::State state);
  18. uint getRank(const Vector& from, const Vector& to, Fields::State state) const;
  19. uint getStoneTakes(const Vector& from, const Vector& to) const;
  20. uint getStoneFreedom(const Vector& from, Fields::State state) const;
  21. uint getFreedom(Fields::State state) const;
  22. uint move(const Vector& from, const Vector& to);
  23. void makeSelection();
  24. void makeMove();
  25. void takeStone();
  26. int getQuality(const Vector& from, const Vector& to) const;
  27. int countBlack() const;
  28. bool isTakingPossible() const;
  29. uint getBestEnemyRank() const;
  30. Fields fields;
  31. Vector active;
  32. Vector direction;
  33. bool mustTake;
  34. List<Vector, 20> lastLocations;
  35. static std::array<Vector, 8> neighbours;
  36. static std::array<Vector, 9 * 5> fieldVectors;
  37. static long int getNanos();
  38. static long int selectionTime;
  39. static long int moveTime;
  40. static int turns;
  41. static int moves;
  42. };
  43. #endif