-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnitState.h
71 lines (51 loc) · 1.35 KB
/
UnitState.h
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
//
// Created by Alex on 03.09.18.
//
#ifndef ARMY_UNITSTATE_H
#define ARMY_UNITSTATE_H
#include <iostream>
#include <string>
#include "list"
class Unit;
enum Form {HUMAN, WOLF};
class UnitState
{
private:
std::string name;
Form form;
int hitPointsLimit;
int hitPoints;
int atackPower;
bool _notify;
std::list<UnitState*> observers;
protected:
virtual void update();
int manaLimit;
int manaReserve;
public:
UnitState();
const std::string &getName() const;
int getHitPointsLimit() const;
int getHitPoints() const;
int getAtackPower() const;
Form getForm() const;
int getManaLimit() const;
int getManaReserve() const;
void setName(const std::string &name);
void setHitPointsLimit(int hitPointsLimit);
void setHitPoints(int hitPoints);
void setAtackPower(int atackPower);
void setForm(Form form);
virtual void setManaLimit(int manaLimit);
virtual void setManaReserve(int manaReserve);
bool ensureIsAlive();
virtual void addHp(int Hp);
virtual void takeDamage(int Hp);
virtual void takeMagicDamage(int Hp);
virtual void takeMana(int mana);
virtual void takeHolyWaterDamage(int Hp);
virtual void addObserver(UnitState* observer);
virtual void removeObserver(UnitState* observer);
virtual ~UnitState();
};
#endif //ARMY_UNITSTATE_H