-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rook.h
30 lines (23 loc) · 780 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
29
30
#ifndef ROOK_H
#define ROOK_H
#include "Piece.h"
class Rook : public Piece
{
public:
bool legal_move_shape( std::pair< char , char > start , std::pair< char , char > end ) const;
bool legal_capture_shape( std::pair< char , char > start , std::pair< char , char > end ) const {
return legal_move_shape(start, end);
}
~Rook() { }
/////////////////////////////////////
// DO NOT MODIFY THIS FUNCTION!!!! //
/////////////////////////////////////
char to_ascii( void ) const { return is_white() ? 'R' : 'r'; }
private:
/////////////////////////////////////
// DO NOT MODIFY THIS FUNCTION!!!! //
/////////////////////////////////////
Rook( bool is_white ) : Piece( is_white ) {}
friend Piece* create_piece( char );
};
#endif // ROOK_H