#include "CAbstractScript.hpp"
//#include "../../../Controller/CKernel.hpp"

namespace CosmicCore {
    //CPlugin<CAbstractScript>* CAbstractScript::m_scriptPLugin = nullptr;

    CAbstractScript::CAbstractScript(CEntity& entity) : CAbstractComponent(entity) 
    { 
        //m_kernelPTR = CKernel::m_kernel; 
    }

    nlohmann::json CAbstractScript::to_json()
    {
        nlohmann::json absScript;
        absScript["scriptName"] = m_scriptName;
        absScript["ComponentType"] = EComponentType::COMPONENT_SCRIPT;
        return absScript;
    }

    CAbstractScript* CAbstractScript::from_json(CEntity& entity, nlohmann::json& j)
    {
        /*std::string name = j["scriptName"];
        CAbstractScript* script = CAbstractScript::m_scriptPLugin->useCreator("instantiate"+name);
        script->setEntity(entity);
        script->setKernel(CKernel::m_kernel);
        script->start();
        return script;*/
        return nullptr;
    }
}


