Figure.h 722 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef _FIGURE_H
  2. #define _FIGURE_H
  3. #include "Position.h"
  4. #include <utility>
  5. #include <vector>
  6. using namespace std;
  7. class Figure
  8. {
  9. protected:
  10. Position position;
  11. char color;
  12. public:
  13. // Получить возможные движения фигуры на доске
  14. // вернёт moves_count - количество возможных ходов
  15. // и список из char[2] - сами ходы (вида A5, B3 и т.п.)
  16. virtual vector<Position> get_moves() = 0;
  17. virtual Figure* copy() = 0;
  18. virtual const char* print() = 0;
  19. Position get_position(){return position;}
  20. void set_position(Position pos){position = pos;}
  21. char get_color(){return color;}
  22. };
  23. #endif