-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAComponent.cpp
More file actions
48 lines (40 loc) · 840 Bytes
/
AComponent.cpp
File metadata and controls
48 lines (40 loc) · 840 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
#include "AComponent.h"
#include <iostream>
AComponent::AComponent(String name, ComponentType type, AGameObject* owner)
{
this->name = name;
this->owner = owner;
this->type = type;
}
AComponent::~AComponent()
{
this->owner = NULL;
this->type = NotSet;
}
void AComponent::attachOwner(AGameObject* owner)
{
this->owner = owner;
}
void AComponent::detachOwner()
{
//if object owner gets detached. then component must also be deleted.
this->owner = NULL;
}
AGameObject* AComponent::getOwner()
{
return this->owner;
}
AComponent::ComponentType AComponent::getType()
{
return this->type;
}
AComponent::String AComponent::getName()
{
if (this == NULL) {
std::cout << "THIS IS NULL FOR SOME REASON?!?!?!?! \n";
}
return this->name;
}
void AComponent::perform(float deltaTime)
{
}