-
Notifications
You must be signed in to change notification settings - Fork 0
/
XiangqiBoard.h
32 lines (27 loc) · 1.11 KB
/
XiangqiBoard.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
#pragma once
#include "Board.h"
class XiangqiBoard : public Board
{
public:
XiangqiBoard();
~XiangqiBoard() override;
void Initialize() override;
Board* Clone() override;
Piece* CreatePiece(PieceType pieceType, PieceColour pieceColour, bool isPromoted = false) override;
void GetMoves(Piece *piece, int x, int y) override;
protected:
private:
void CheckCannonDirection(const Piece *piece, int x, int y, Direction direction);
PieceType _initialSetup[10][9] = {
{ Rook, WhiteHorse, Elephant, Silver, King, Silver, Elephant, WhiteHorse, Rook },
{ None, None, None, None, None, None, None, None, None },
{ None, Cannon, None, None, None, None, None, Cannon, None },
{ Pawn, None, Pawn, None, Pawn, None, Pawn, None, Pawn },
{ None, None, None, None, None, None, None, None, None },
{ None, None, None, None, None, None, None, None, None },
{ Pawn, None, Pawn, None, Pawn, None, Pawn, None, Pawn },
{ None, Cannon, None, None, None, None, None, Cannon, None },
{ None, None, None, None, None, None, None, None, None },
{ Rook, WhiteHorse, Elephant, Silver, King, Silver, Elephant, WhiteHorse, Rook }
};
};