1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #ifndef GAME_H
- #define GAME_H
- #include <array>
- #include "String.h"
- #include "Types.h"
- class Game final {
- public:
- enum FieldState {
- BLACK, WHITE, EMPTY
- };
- Game();
- void parse();
- private:
- void consumeLine() const;
- void consumeLine(uint index);
- void parseFields();
- void selectStone();
- void selectLocationToMove();
- void selectStoneToTake();
- bool isInRange(int x, int y) const;
- void print(String& s) const;
- void printLine(String& s, int index) const;
- int getRank(int x, int y, int x2, int y2) const;
- bool areNeighbours(int x, int y, int x2, int y2) const;
- void addLocation(int x, int y);
- bool isInQueue(int x, int y) const;
- FieldState fields[9][5];
- int activeX;
- int activeY;
- int directionX;
- int directionY;
- struct Location {
- int x;
- int y;
- };
- std::array<Location, 20> lastLocations;
- uint lastLocation;
- };
- #endif
|