summaryrefslogtreecommitdiffstats
path: root/grid.cpp
blob: ff3e6df1af4e13a00843b3fd347e787a1d220a4b (plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
 * grid.cpp
 *
 *
 */

#include "grid.h"

Grid::Grid(void) : rows(0), cols(0), numOfMoves(0), lastMoved(0), lastMoveDir(0), board(NULL)
{
}

#if 0
Grid::Grid(const Grid &grid) : rows(grid.rows), cols(grid.cols), numOfMoves(grid.numOfMoves),
                               lastMoved(grid.lastMoved), lastMoveDir(grid.lastMoveDir), board(new string(*grid.board))
{

}
#endif

int *Grid::getRows(void)
{
    return &rows;
}

int *Grid::getCols(void)
{
    return &cols;
}

int *Grid::getNumOfMoves(void)
{
    return &numOfMoves;
}

vector<Piece> *Grid::getPieces(void)
{
    return &pieces;
}

void Grid::setRows(int n)
{
    rows = n;
}

void Grid::setCols(int n)
{
    cols = n;
}

void Grid::addMove(string move)
{
    moves.push_back(move);
}

void Grid::markPiecesPos(void)
{
}

void Grid::setlastMoved(int dir)
{
    lastMoved = dir;
}

int Grid::getlastMoved(void)
{
    return lastMoved;
}

void Grid::printMoves(void)
{
    vector<string>::iterator iter;
    for (iter = moves.begin(); iter != moves.end(); ++iter)
        cout << *iter;
}