-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComponent.cpp
More file actions
54 lines (33 loc) · 858 Bytes
/
Component.cpp
File metadata and controls
54 lines (33 loc) · 858 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
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "Component.h"
#include "Visitor.h"
unsigned int Component::s_iAllocatedMemorySize = 0;
Component::Component(Component::Type type) {
m_iType = type;
//m_xGameObject = nullptr;
}
Component::~Component() {
}
void* Component::operator new(size_t size) {
void* ptr = ::operator new(size);
s_iAllocatedMemorySize += _msize(ptr);
return ptr;
}
void* Component::operator new(size_t size, void* p) {
return ::operator new(size, p);
}
void Component::operator delete(void* ptr) {
s_iAllocatedMemorySize -= _msize(ptr);
::operator delete(ptr);
}
unsigned int Component::getAllocatedMemorySize() {
return s_iAllocatedMemorySize;
}
void Component::accept(Visitor* visitor) {
visitor->visitComponent(this);
}
Component::Type Component::getType() {
return m_iType;
}
GameObject* Component::getGameObject() {
return m_xGameObject;
}