-
Notifications
You must be signed in to change notification settings - Fork 0
/
Move.cpp
54 lines (41 loc) · 906 Bytes
/
Move.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
44
45
46
47
48
49
50
51
52
53
54
// -*-c++-*-
#include "Move.h"
#include "game.h"
Move::Move(_Move* pointer)
{
ptr = (void*) pointer;
}
int Move::id()
{
return ((_Move*)ptr)->id;
}
int Move::fromFile()
{
return ((_Move*)ptr)->fromFile;
}
int Move::fromRank()
{
return ((_Move*)ptr)->fromRank;
}
int Move::toFile()
{
return ((_Move*)ptr)->toFile;
}
int Move::toRank()
{
return ((_Move*)ptr)->toRank;
}
int Move::promoteType()
{
return ((_Move*)ptr)->promoteType;
}
std::ostream& operator<<(std::ostream& stream,Move ob)
{
stream << "id: " << ((_Move*)ob.ptr)->id <<'\n';
stream << "fromFile: " << ((_Move*)ob.ptr)->fromFile <<'\n';
stream << "fromRank: " << ((_Move*)ob.ptr)->fromRank <<'\n';
stream << "toFile: " << ((_Move*)ob.ptr)->toFile <<'\n';
stream << "toRank: " << ((_Move*)ob.ptr)->toRank <<'\n';
stream << "promoteType: " << ((_Move*)ob.ptr)->promoteType <<'\n';
return stream;
}