-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgameObject.h
More file actions
43 lines (32 loc) · 804 Bytes
/
gameObject.h
File metadata and controls
43 lines (32 loc) · 804 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
#pragma once
#include <iostream>
#include <vector>
#include <unordered_map>
#include "component.h"
#include "transform.h"
class GameObject
{
private:
static int nextID;
int gameID;
bool isQueuedForRemoval;
std::unordered_map<ComponentType, Component*> components;
public:
Transform* transform;
public:
GameObject();
~GameObject();
void awake();
void start();
void earlyUpdate();
void update();
void lateUpdate();
void render(sf::RenderWindow* window);
void addComponent(Component* newComponent);
void removeComponent(ComponentType componentType);
Component* getComponent(ComponentType componentType);
bool hasComponent(ComponentType componentType);
void queueForRemoval();
bool getQueuedForRemoval() { return this->isQueuedForRemoval; }
int getID() { return gameID; };
};