Initial commit - restart from existing code

This commit is contained in:
Tom Ray
2026-02-13 19:15:05 +01:00
parent 11df621bb2
commit 7c352bc280
1906 changed files with 491226 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
#ifndef CABSTRACT_COMPONENT_HPP
#define CABSTRACT_COMPONENT_HPP
#include "../Utils/CSerializable.hpp"
#include "../Entity/CEntity.hpp"
namespace CosmicCore {
/**
* @brief Enum representing every type of component that can be created.
*/
enum class EComponentType : unsigned char {
COMPONENT_SCRIPT,
COMPONENT_CAMERA,
COMPONENT_LIGHT,
COMPONENT_RIGIDBODY,
COMPONENT_COLLIDER,
COMPONENT_CUSTOM,
COMPONENT_RENDERER,
COMPONENT_META,
COMPONENT_COUNT
};
constexpr std::string typeToString(EComponentType type);
class CAbstractComponent : public CSerializable{
public:
CAbstractComponent(CEntity& entity): m_owningEntity(entity){};
virtual ~CAbstractComponent() = default;
CEntity& getEntity() {
return m_owningEntity;
}
virtual nlohmann::json to_json() = 0;
private:
/**
* @brief The entity to which the component is linked.
*/
CEntity m_owningEntity;
};
}
#endif