-
Notifications
You must be signed in to change notification settings - Fork 0
/
GamePiece.cpp
78 lines (65 loc) · 1.34 KB
/
GamePiece.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include "GamePiece.h"
#include <iostream>
GamePiece::GamePiece(int playerNr, int bombs, int strength, int stones)
: _playerNr(playerNr), _bombsNr(bombs), _strenghtBombs(strength), _overrideStonesNr(stones), _isDisqualified(false)
{}
int GamePiece::getPlayerNr() const
{
return _playerNr;
}
void GamePiece::setPlayerNr(const int playerNr)
{
_playerNr = playerNr;
}
int GamePiece::getBombsNr() const
{
return _bombsNr;
}
int GamePiece::getBombsStrength() const
{
return _strenghtBombs;
}
int GamePiece::getOverrideStonesNr() const
{
return _overrideStonesNr;
}
void GamePiece::setBombsNrHigher()
{
_bombsNr++;
}
void GamePiece::setOverrideStonesNrHigher()
{
_overrideStonesNr++;
}
bool GamePiece::setOverrideStonesLower()
{
if (_overrideStonesNr <= 0)
return false;
else
{
_overrideStonesNr--;
return true;
}
}
bool GamePiece::setBombsLower()
{
if (_bombsNr <= 0)
return false;
else
{
_bombsNr--;
return true;
}
}
bool GamePiece::getIsDisqualified() const
{
return _isDisqualified;
}
void GamePiece::setIsDisqualified(const bool isDisqualified)
{
_isDisqualified = isDisqualified;
}
void GamePiece::print() const {
std::cout << "Anzahl Überschreibsteine: " << _overrideStonesNr << std::endl;
std::cout << "Anzahl Bomben: " << _bombsNr << std::endl;
}