-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCharacter.cpp
More file actions
41 lines (34 loc) · 731 Bytes
/
Character.cpp
File metadata and controls
41 lines (34 loc) · 731 Bytes
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
#include "Character.h"
#include "ObjectGame.h"
using namespace std;
Character::Character(const wstring& Name,
const int& HealthPoint,
const int& speed,
const wchar_t& object_chr,
const wstring& color_in_hex,
bool HitBox) :
ObjectGame(object_chr, color_in_hex, HitBox),
m_HealthPoint(HealthPoint),
m_Name(Name),
m_Speed(speed)
{}
inline void Character::Damage(int minus_HP)
{
m_HealthPoint -= minus_HP;
}
inline int Character::GetHealtPoint()
{
return m_HealthPoint;
}
wstring Character::GetName()
{
return m_Name;
}
bool operator==(const wchar_t& wchar, Character& charac)
{
return wchar == charac.GetWChar_t_of_Object();
}
int Character::GetSpeed()
{
return m_Speed;
}