-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathCaracteristique.cpp
More file actions
96 lines (80 loc) · 1.74 KB
/
Caracteristique.cpp
File metadata and controls
96 lines (80 loc) · 1.74 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#include <iostream>
#include "Caracteristique.hpp"
Caracteristique::Caracteristique(const unsigned int& life)
{
this->_life = 1;
this->_speed = 2;
this->_actualBomb = 0;
this->_maxBomb = 1;
this->_range = 0;
}
const unsigned int& Caracteristique::getLife() const
{
return this->_life;
}
const unsigned int& Caracteristique::getSpeed() const
{
return this->_speed;
}
const unsigned int& Caracteristique::getMaxBomb(void) const
{
return this->_maxBomb;
}
const unsigned int& Caracteristique::getActualBomb(void) const
{
return this->_actualBomb;
}
const unsigned int& Caracteristique::getRange(void) const
{
return this->_range;
}
void Caracteristique::setLife(const unsigned int& life)
{
this->_life = life;
}
void Caracteristique::setSpeed(const unsigned int& speed)
{
this->_speed = speed;
}
void Caracteristique::setRange(const unsigned int& range)
{
this->_range = range;
}
void Caracteristique::setActualBomb(const unsigned int& bomb)
{
this->_actualBomb = bomb;
}
void Caracteristique::setMaxBomb(const unsigned int& maxBomb)
{
this->_maxBomb = maxBomb;
}
bool Caracteristique::putBomb(void)
{
if (this->_actualBomb < _maxBomb)
{
_actualBomb++;
return true;
}
return false;
}
void Caracteristique::delBomb(void)
{
this->_actualBomb--;
}
void Caracteristique::increaseSpeed(const unsigned int& toAdd)
{
if (this->_speed < 6)
this->_speed += toAdd;
}
void Caracteristique::increaseLife(const unsigned int& toAdd)
{
this->_life += toAdd;
}
void Caracteristique::increaseRange(const unsigned int& toAdd)
{
this->_range += toAdd;
}
void Caracteristique::increaseBomb(const unsigned int& toAdd)
{
this->_maxBomb += toAdd;
}