ttt_simple.h 582 B

12345678910111213141516171819202122232425
  1. //
  2. // Created by nositelshtanov on 11/11/2023.
  3. //
  4. #ifndef TTT_TTT_SIMPLE_H
  5. #define TTT_TTT_SIMPLE_H
  6. #include "ttt_engine.h"
  7. class ttt_simple: public ttt_engine {
  8. public:
  9. explicit ttt_simple(mark who_step_first) : whose_step(who_step_first) {}
  10. ttt_simple() : ttt_simple(mark::cross) {}
  11. mark get_whose_step() const { return whose_step; }
  12. void step(std::size_t field_num) {
  13. ttt_engine::step(whose_step, field_num);
  14. whose_step = whose_step == mark::cross ? mark::zero : mark::cross;
  15. }
  16. private:
  17. mark whose_step;
  18. };
  19. #endif //TTT_TTT_SIMPLE_H