-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKing.cpp
More file actions
43 lines (35 loc) · 1015 Bytes
/
Copy pathKing.cpp
File metadata and controls
43 lines (35 loc) · 1015 Bytes
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
37
38
39
40
41
42
43
/****************************************************/
/* */
/* Date Created: 02/12/14 */
/* Description: Implementation of King class. */
/* A king is a ChessPiece */
/* */
/* Date Who Description of Change */
/* 20141202 HL Created. */
/****************************************************/
#include <string>
#include <cstdlib>
#include "King.hpp"
using namespace std;
King::King(colours _colour) {
colour = _colour;
moves[0] = NORTH;
moves[1] = NORTH_EAST;
moves[2] = EAST;
moves[3] = SOUTH_EAST;
moves[4] = SOUTH;
moves[5] = SOUTH_WEST;
moves[6] = WEST;
moves[7] = NORTH_WEST;
number_of_moves = 8;
}
King::~King() {
return;
}
int King::getMoveMultiple(move_type direction) {
if(has_moved)
return 1;
if (direction == EAST || direction == WEST)
return 2;
return 1;
}