-
Notifications
You must be signed in to change notification settings - Fork 0
/
Pawn.h
31 lines (23 loc) · 781 Bytes
/
Pawn.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
#ifndef PAWN_H
#define PAWN_H
#include "Piece.h"
class Pawn : 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);
}
~Pawn() { }
/////////////////////////////////////
// DO NOT MODIFY THIS FUNCTION!!!! //
/////////////////////////////////////
char to_ascii( void ) const { return is_white() ? 'P' : 'p'; }
private:
/////////////////////////////////////
// DO NOT MODIFY THIS FUNCTION!!!! //
/////////////////////////////////////
Pawn( bool is_white ) : Piece( is_white ) {}
friend Piece* create_piece( char );
};
#endif // PAWN_H