Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/system/IComponent.h
Context not available. | |||||
{ | { | ||||
public: | public: | ||||
// Component allocation types | // Component allocation types | ||||
using AllocFunc = IComponent* (*)(const ScriptInterface& scriptInterface, JS::HandleValue ctor); | using AllocFunc = IComponent* (*)(void* slot, const ScriptInterface& scriptInterface, JS::HandleValue ctor); | ||||
using DeallocFunc = void (*)(IComponent*); | using DeallocFunc = void (*)(IComponent*); | ||||
virtual ~IComponent(); | virtual ~IComponent(); | ||||
static std::string GetSchema(); | static std::string GetSchema(); | ||||
static void RegisterComponentType(CComponentManager& mgr, EInterfaceId iid, EComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, const char* name, const std::string& schema); | static void RegisterComponentType(CComponentManager& mgr, EInterfaceId iid, EComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, size_t size, size_t align, const char* name, const std::string& schema); | ||||
static void RegisterComponentTypeScriptWrapper(CComponentManager& mgr, EInterfaceId iid, EComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, const char* name, const std::string& schema); | static void RegisterComponentTypeScriptWrapper(CComponentManager& mgr, EInterfaceId iid, EComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, size_t size, size_t align, const char* name, const std::string& schema); | ||||
virtual void Init(const CParamNode& paramNode) = 0; | virtual void Init(const CParamNode& paramNode) = 0; | ||||
virtual void Deinit() = 0; | virtual void Deinit() = 0; | ||||
Context not available. | |||||
virtual bool NewJSObject(const ScriptInterface& scriptInterface, JS::MutableHandleObject out) const; | virtual bool NewJSObject(const ScriptInterface& scriptInterface, JS::MutableHandleObject out) const; | ||||
virtual JS::Value GetJSInstance() const; | virtual JS::Value GetJSInstance() const; | ||||
virtual int GetComponentTypeId() const = 0; | virtual int GetComponentTypeId() const = 0; | ||||
void SetInvalid() { m_EntityHandle.SetInvalid(); } | |||||
bool IsValid() const { return GetEntityId() != INVALID_ENTITY; } | |||||
private: | private: | ||||
CEntityHandle m_EntityHandle; | CEntityHandle m_EntityHandle; | ||||
Context not available. |
Wildfire Games · Phabricator