engine/include/components/component.hpp

47 lines
663 B
C++
Raw Normal View History

2022-09-02 11:06:59 +00:00
#pragma once
2022-09-07 09:02:01 +00:00
#include "engine_api.h"
2022-09-02 23:02:09 +00:00
2022-10-02 15:34:51 +00:00
namespace engine {
class Window;
class Input;
2022-10-06 10:30:44 +00:00
class Object;
class ResourceManager;
2022-09-02 11:06:59 +00:00
2022-10-06 10:30:44 +00:00
class ENGINE_API Component {
2022-09-02 11:06:59 +00:00
2022-10-06 10:30:44 +00:00
public:
2022-09-02 11:06:59 +00:00
2022-10-06 10:30:44 +00:00
enum class TypeEnum {
TRANSFORM,
CAMERA,
RENDERER,
UI,
CUSTOM,
};
Component(Object* parent, TypeEnum type);
Component(const Component&) = delete;
Component& operator=(const Component&) = delete;
virtual ~Component() = 0;
2022-09-02 11:06:59 +00:00
2022-10-06 10:30:44 +00:00
int getID();
TypeEnum getType();
2022-09-02 11:06:59 +00:00
2022-10-06 10:30:44 +00:00
Object& parent;
2022-09-02 11:06:59 +00:00
2022-10-06 10:30:44 +00:00
protected:
engine::Window& win;
engine::Input& inp;
ResourceManager& res;
2022-09-02 11:06:59 +00:00
2022-10-06 10:30:44 +00:00
private:
static int s_next_component_id;
2022-09-02 11:06:59 +00:00
2022-10-06 10:30:44 +00:00
int m_id = s_next_component_id;
TypeEnum m_type;
};
2022-09-02 11:06:59 +00:00
2022-10-06 10:30:44 +00:00
}