-
Notifications
You must be signed in to change notification settings - Fork 0
/
Pawn.h
36 lines (28 loc) · 860 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
32
33
34
35
36
// Joshua Hahn jhahn19
// Kevin Kim kkim170
// Elissa Matlock ematloc1
#ifndef PAWN_H
#define PAWN_H
#include "Piece.h"
namespace Chess
{
class Pawn : public Piece {
public:
//determines legal move shape.
bool legal_move_shape(std::pair<char, char> start, std::pair<char, char> end) const;
/////////////////////////////////////
// DO NOT MODIFY THIS FUNCTION!!!! //
/////////////////////////////////////
char to_ascii() const {
return is_white() ? 'P' : 'p';
}
bool legal_capture_shape(std::pair<char, char> start, std::pair<char, char> end) const;
private:
/////////////////////////////////////
// DO NOT MODIFY THIS FUNCTION!!!! //
/////////////////////////////////////
Pawn(bool is_white) : Piece(is_white) {}
friend Piece* create_piece(char piece_designator);
};
}
#endif // PAWN_H