relatorio
[xYpjg3TdSw.git] / MoveHistoryEntry.cpp
blob86e6baafec1b102c12b235d4ea8d90060566f3c1
1 #include "MoveHistoryEntry.h"
2 #include "Board.h"
4 #include <cstdio>
6 MoveHistoryEntry::MoveHistoryEntry()
8 _board = NULL;
9 _from_x = _from_y = _to_x = _to_y = -1;
12 MoveHistoryEntry::MoveHistoryEntry(Board *board, int fromX, int fromY, int toX, int toY)
14 _board = board->copy();
15 _from_x = fromX;
16 _from_y = fromY;
17 _to_x = toX;
18 _to_y = toY;
21 const MoveHistoryEntry& MoveHistoryEntry::operator=(const MoveHistoryEntry& entry)
23 if(_board) delete _board;
24 _board = entry._board;
25 _from_x = entry._from_x;
26 _from_y = entry._from_y;
27 _to_x = entry._to_x;
28 _to_y = entry._to_y;
29 return *this;