-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMove.hpp
52 lines (42 loc) · 1.09 KB
/
Move.hpp
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
44
45
46
47
48
49
50
51
52
//
// Move.hpp for ChessIA in /home/wilmot_p/PROG/C++/ChessIA
//
// Made by WILMOT Pierre
// Login <[email protected]>
//
// Started on Wed Dec 26 02:10:25 2012 WILMOT Pierre
// Last update Fri Jan 18 02:19:32 2013 WILMOT Pierre
//
#ifndef __MOVE_HPP__
#define __MOVE_HPP__
#include <iostream>
#include "GameData.hpp"
class Move : public GameData
{
public:
/* p is used to specify the piece to use in case of pawn promotion */
Move(GameData const &g, int sx, int sy, int dx, int dy, GameData::piece p = GameData::Empty);
~Move();
GameData const & getGameData() const;
void setGameData(GameData const &g);
int getSX() const;
int getSY() const;
int getDX() const;
int getDY() const;
void setSX(int sx);
void setSY(int sy);
void setDX(int dx);
void setDY(int dy);
void apply();
std::string getLAN() const;
// LAN : Long algebraic notation
void setFromLAN(std::string const &s);
private:
int m_srcx;
int m_srcy;
int m_destx;
int m_desty;
GameData::piece m_promotion;
};
std::ostream& operator<<(std::ostream &os, Move const &m);
#endif