blob: b755e3cdfc7620f54e7eab1eaeb5ed046b8b8e7c (
plain) (
blame)
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
|
#include "../Entities/Pawn.h"
#include "MobPointer.h"
cMobPointer::cMobPointer(cPawn * a_Pointer) : m_Pointer(a_Pointer)
{
// Constructor
}
cMobPointer::cMobPointer(const cMobPointer & a_MobPointer) : m_Pointer(a_MobPointer.m_Pointer)
{
// Copy constructor
}
cMobPointer::cMobPointer(cMobPointer && a_MobPointer)
{
// move Constructor
m_Pointer = a_MobPointer.m_Pointer;
a_MobPointer.m_Pointer = nullptr;
}
cMobPointer& cMobPointer::operator=(const cMobPointer& a_MobPointer)
{
// Copy assignment operator
m_Pointer = a_MobPointer.m_Pointer;
return *this;
}
cMobPointer& cMobPointer::operator=(cMobPointer&& a_MobPointer)
{
// Move assignment operator
m_Pointer = a_MobPointer.m_Pointer;
a_MobPointer.m_Pointer = nullptr;
return *this;
}
void cMobPointer::operator=(cPawn * a_Pointer)
{
m_Pointer = a_Pointer;
}
cPawn * cMobPointer::GetPointer()
{
if (m_Pointer != nullptr)
{
if (!m_Pointer->IsTicking())
{
m_Pointer = nullptr;
}
}
return m_Pointer;
}
|