-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCreatureCard.cpp
118 lines (101 loc) · 3.01 KB
/
CreatureCard.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
//------------------------------------------------------------------------------
// CreatureCard.cpp
//
// Group: Group 9, study assistant David Kerschbaumer
//
// Authors: Michael Zweimüller 11916150
// Martin Schachl 11907003
// Johannes Aigner 11907005
//------------------------------------------------------------------------------
//
#include "CreatureCard.hpp"
using Oop::Card;
using Oop::CreatureCard;
//------------------------------------------------------------------------------
CreatureCard::CreatureCard(std::string name, int mana_cost, int damage_points,
int life_points, bool shield, bool mana_drain, bool speedy) :
Card(name, mana_cost, CardType::CREATURE),
damage_points_(damage_points),
life_points_(life_points),
current_life_points_(life_points),
shield_(shield),
mana_drain_(mana_drain),
ready_to_fight_(false),
already_attacked_(false),
speedy_(false)
{
//TODO
//speedy_ = speedy; for bonus task (Deliverable 3)
}
//------------------------------------------------------------------------------
CreatureCard::CreatureCard(const CreatureCard &temp) : Card(temp),
damage_points_(temp.getDamagePoints()),
life_points_(temp.getLifePoints()),
current_life_points_(temp.getCurrentLifePoints()),
shield_(temp.getShield()),
mana_drain_(temp.getManaDrain()),
ready_to_fight_(temp.getReadyToFight()),
already_attacked_(temp.getAlreadyAttacked()),
speedy_(temp.getSpeedy())
{
}
//------------------------------------------------------------------------------
CreatureCard::~CreatureCard()
{
}
//------------------------------------------------------------------------------
int CreatureCard::getLifePoints() const
{
return life_points_;
}
//------------------------------------------------------------------------------
int CreatureCard::getDamagePoints() const
{
return damage_points_;
}
//------------------------------------------------------------------------------
bool CreatureCard::getManaDrain() const
{
return mana_drain_;
}
//------------------------------------------------------------------------------
bool CreatureCard::getShield() const
{
return shield_;
}
//------------------------------------------------------------------------------
int CreatureCard::getCurrentLifePoints() const
{
return current_life_points_;
}
//------------------------------------------------------------------------------
bool CreatureCard::getReadyToFight() const
{
return ready_to_fight_;
}
//------------------------------------------------------------------------------
bool CreatureCard::getAlreadyAttacked() const
{
return already_attacked_;
}
//------------------------------------------------------------------------------
bool CreatureCard::getSpeedy() const
{
return speedy_;
}
void CreatureCard::setAlreadyAttacked(bool rdy)
{
already_attacked_ = rdy;
}
void CreatureCard::setReadyToFight(bool rdy)
{
ready_to_fight_ = rdy;
}
//TODO for attack command
/*void CreatureCard::reduceLifePoints(int reduce_lifepoints)
{
if(current_life_points - reduce_lifepoints < 1)
{
current_life_points = 0;
}
}*/