-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGame.h
More file actions
36 lines (30 loc) · 824 Bytes
/
Game.h
File metadata and controls
36 lines (30 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once
#include "Point.h"
#include "Piece.h"
#include "Desk.h"
class Game{
public:
Game() : cur_color_move(white) {};
virtual void move(const Piece*, const Point& from, const Point& to) {};
virtual void InitDesk() {}; //initialize desk
virtual void ChoiseOfPlayer(); //action in game
virtual bool EndOfGame();
protected:
Desk<8> _desk;
int _count_white;
int _count_black;
private:
bool choise;
Piece_color cur_color_move;
};
class ChessGame : public Game
{
friend Piece_type piece_type(const Point& p);
public:
ChessGame();
virtual void InitDesk(Desk<8>& desk); //ìîæíî ëè ïðîïèñàòü â òàêîì âàðèàíòå template? íå õî÷ó çàâèñåòü íà ÷èñëå "<8>"
virtual void move(const Piece* p, const Point& from, const Point& to);
private:
static const int FIGURES_ROW = 2;
static const int FIGURES_ON_ROW = 8;
};