Vivid
Loading...
Searching...
No Matches
Entity.h
1#pragma once
2
3#include "common/types/Types.h"
4#include "editor/camera/Camera.h"
5#include "core/ecs/ComponentType.h"
6
7namespace Vivid
8{
11
18 class Entity
19 {
20 private:
21 int m_ID = 0;
22 String m_Name;
23 Vector<int> m_Components;
24
25 public:
26 Entity() = default;
27 Entity(int id, String name);
28 ~Entity() = default;
29
30 void Draw(Camera* camera);
31 void ImguiRender();
32 void DrawGizmo(Camera* camera);
33
34 [[nodiscard]]
35 int GetEntityID() const { return m_ID; }
36 [[nodiscard]]
37 String GetName() const { return m_Name; }
38 void SetName(String& name) { m_Name = std::move(name); }
39 void SetName(String&& name) { m_Name = name; }
40
47 int HasComponent(ComponentType ct);
48
49 void RemoveComponent(const int& componentID);
50 void AddComponent(const int& componentID);
51 };
52
53}
A class that represents the camera.
Definition: Camera.h:25
Contains an Entity.
Definition: Entity.h:19
int HasComponent(ComponentType ct)
Checks if the Entity has a component.
Definition: Entity.cpp:54