2026-02-13 19:15:05 +01:00
|
|
|
#include "CEntity.hpp"
|
|
|
|
|
#include "nlohmann/json_fwd.hpp"
|
|
|
|
|
|
2026-04-17 21:00:35 +02:00
|
|
|
#include <functional>
|
2026-02-13 19:15:05 +01:00
|
|
|
|
|
|
|
|
namespace CosmicCore
|
|
|
|
|
{
|
|
|
|
|
|
2026-04-17 21:00:35 +02:00
|
|
|
CEntity::CEntity(std::reference_wrapper<EntityComponentManager> registry, EntityId handle, CScene* scene) : CSerializable(), m_scene(scene), m_registryReference(registry), m_handle(handle)
|
2026-02-13 19:15:05 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-14 20:24:17 +01:00
|
|
|
CEntity::CEntity(const CEntity& cop): m_scene(cop.m_scene), m_registryReference(cop.m_registryReference), m_handle(cop.m_handle){
|
2026-02-13 19:15:05 +01:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-17 21:00:35 +02:00
|
|
|
CEntity& CEntity::operator=(const CEntity& ent)
|
|
|
|
|
{
|
|
|
|
|
m_handle = ent.m_handle;
|
|
|
|
|
m_registryReference = ent.m_registryReference;
|
|
|
|
|
m_scene = ent.m_scene;
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-14 20:24:17 +01:00
|
|
|
CScene* CEntity::getScene()
|
2026-02-13 19:15:05 +01:00
|
|
|
{
|
|
|
|
|
return m_scene;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-14 20:24:17 +01:00
|
|
|
void CEntity::setScene(CScene* s)
|
2026-02-13 19:15:05 +01:00
|
|
|
{
|
|
|
|
|
m_scene = s;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-17 21:00:35 +02:00
|
|
|
/*CEntity CEntity::getParent() {
|
2026-02-13 19:15:05 +01:00
|
|
|
//to implement
|
2026-04-17 21:00:35 +02:00
|
|
|
}*/
|
2026-02-13 19:15:05 +01:00
|
|
|
|
|
|
|
|
nlohmann::json CEntity::to_json(){return nlohmann::json();};
|
|
|
|
|
}
|