Fields.h 653 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef FIELDS_H
  2. #define FIELDS_H
  3. #include "Vector.h"
  4. #include "String.h"
  5. class Fields final {
  6. public:
  7. enum State {
  8. BLACK, WHITE, EMPTY
  9. };
  10. bool hasState(const Vector& v, State state) const;
  11. State getState(const Vector& v) const;
  12. void setState(const Vector& v, State state);
  13. void print(const Vector& active);
  14. void read();
  15. private:
  16. char getChar(int x, int y, const Vector& active) const;
  17. void toString(String& s, const Vector& active) const;
  18. void lineToString(String& s, int y, const Vector& active) const;
  19. void consumeLine() const;
  20. void readLine(uint y);
  21. State fields[9][5];
  22. };
  23. #endif