-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrook.h
28 lines (22 loc) · 800 Bytes
/
rook.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
#ifndef __ROOK_H__
#define __ROOK_H__
#include <iostream>
#include <vector>
#include "textdisplay.h"
#include "observer.h"
#include "piece.h"
using namespace std;
class Rook : public Piece {
PieceType type = PieceType::Rook;
bool firstMove = true; // Keep track of whether or not this is the Rook's first move.
public:
// Construct a new Rook with colour.
Rook(Colour colour);
bool checkMovementValid(Board &b, int newRow, int newCol, bool calledByPlayer = false) override;
void placePiece(Board & b, int row, int col) override;
vector<vector<int>> checkPossibleMoves(Board &b) override;
// Checks whether or not the Rook can castle on the right and left side.
bool castleRookRight();
bool castleRookLeft();
};
#endif