-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKing.cpp
45 lines (36 loc) · 819 Bytes
/
King.cpp
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
//
// King.cpp for ChessIA in /home/wilmot_p/PROG/C++/ChessIA
//
// Made by WILMOT Pierre
// Login <[email protected]>
//
// Started on Tue Nov 27 00:32:50 2012 WILMOT Pierre
//
#include <iostream>
#include "King.hpp"
King::King(int x, int y, GameData::team t)
: PieceInfo(x, y, t, GameData::King)
{
m_name = "King";
m_directionsNb = 8;
m_directions[0][0] = 1;
m_directions[0][1] = 1;
m_directions[1][0] = 1;
m_directions[1][1] = -1;
m_directions[2][0] = -1;
m_directions[2][1] = 1;
m_directions[3][0] = -1;
m_directions[3][1] = -1;
m_directions[4][0] = 1;
m_directions[4][1] = 0;
m_directions[5][0] = -1;
m_directions[5][1] = 0;
m_directions[6][0] = 0;
m_directions[6][1] = 1;
m_directions[7][0] = 0;
m_directions[7][1] = -1;
m_moveRange = 1;
}
King::~King()
{
}