-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgamevariant.h
39 lines (31 loc) · 884 Bytes
/
gamevariant.h
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
37
38
39
#ifndef __GAMEVARIANT_H
#define __GAMEVARIANT_H
#include "position.h"
#include <QMap>
#include <QSettings>
#include <QSize>
class GameVariant {
public:
QSize size;
QMap<QString, Piece *> pieces;
QMap<QString, QString> notation;
virtual void setup(GamePosition &position) = 0;
virtual QString moveName(GamePosition &position, const Move &move, QPoint ep, Piece *promote, bool white) const;
};
class DefaultGameVariant : public GameVariant {
public:
DefaultGameVariant();
void setup(GamePosition &position) override;
QString moveName(GamePosition &position, const Move &move, QPoint ep, Piece *promote, bool white) const override;
private:
Piece *rookPiece;
Piece *knightPiece;
Piece *bishopPiece;
Piece *queenPiece;
Piece *kingPiece;
Piece *pawnPiece;
};
extern GameVariant *loadedVariant;
extern QSettings *pieceConfig;
void initGameData();
#endif