summaryrefslogtreecommitdiffstats
path: root/piece.cpp
blob: dab969b268f153d9f0aa7cf83f69e34355ff5d72 (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
/*
 * piece.cpp
 *
 *
 */

#include "piece.h"

Piece::Piece(string name_p, int row_p, int col_p, int w_p, int h_p, char dir_p) : name(name_p),
    row(row_p),
    col(col_p),
    w(w_p),
    h(h_p),
    dir(dir_p)
{
}

string Piece::getName(void)
{
    return name;
}

int Piece::getRow(void)
{
    return row;
}

int Piece::getCol(void)
{
    return col;
}

int Piece::getW(void)
{
    return w;
}

int Piece::getH(void)
{
    return h;
}

char Piece::getDir(void)
{
    return dir;
}

/* mark the current position of the piece */
void Piece::markPos(void)
{
    POINT curr = { row, col };
    haveBeen.push_back(curr);
}

vector<POINT> *Piece::gethaveBeen(void)
{
    return &haveBeen;
}

void Piece::setRow(int row_p)
{
    row = row_p;
}

void Piece::setCol(int col_p)
{
    col = col_p;
}