Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/system/ComponentManager.h
Show First 20 Lines • Show All 266 Lines • ▼ Show 20 Lines | public: | ||||
// won't get serialized) | // won't get serialized) | ||||
bool SerializeState(std::ostream& stream) const; | bool SerializeState(std::ostream& stream) const; | ||||
bool DeserializeState(std::istream& stream); | bool DeserializeState(std::istream& stream); | ||||
std::string GenerateSchema() const; | std::string GenerateSchema() const; | ||||
ScriptInterface& GetScriptInterface() { return m_ScriptInterface; } | ScriptInterface& GetScriptInterface() { return m_ScriptInterface; } | ||||
public: | |||||
static CComponentManager* GetComponentManagerFromCxPrivateData(JSContext* cx, JS::CallArgs& callArgs); | |||||
private: | private: | ||||
// Implementations of functions exposed to scripts | // Implementations of functions exposed to scripts | ||||
static void Script_RegisterComponentType_Common(ScriptInterface::CxPrivate* pCxPrivate, int iid, const std::string& cname, JS::HandleValue ctor, bool reRegister, bool systemComponent); | void Script_RegisterComponentType_Common(int iid, const std::string& cname, JS::HandleValue ctor, bool reRegister, bool systemComponent); | ||||
static void Script_RegisterComponentType(ScriptInterface::CxPrivate* pCxPrivate, int iid, const std::string& cname, JS::HandleValue ctor); | void Script_RegisterComponentType(int iid, const std::string& cname, JS::HandleValue ctor); | ||||
static void Script_RegisterSystemComponentType(ScriptInterface::CxPrivate* pCxPrivate, int iid, const std::string& cname, JS::HandleValue ctor); | void Script_RegisterSystemComponentType(int iid, const std::string& cname, JS::HandleValue ctor); | ||||
static void Script_ReRegisterComponentType(ScriptInterface::CxPrivate* pCxPrivate, int iid, const std::string& cname, JS::HandleValue ctor); | void Script_ReRegisterComponentType(int iid, const std::string& cname, JS::HandleValue ctor); | ||||
static void Script_RegisterInterface(ScriptInterface::CxPrivate* pCxPrivate, const std::string& name); | void Script_RegisterInterface(const std::string& name); | ||||
static void Script_RegisterMessageType(ScriptInterface::CxPrivate* pCxPrivate, const std::string& name); | void Script_RegisterMessageType(const std::string& name); | ||||
static void Script_RegisterGlobal(ScriptInterface::CxPrivate* pCxPrivate, const std::string& name, JS::HandleValue value); | void Script_RegisterGlobal(const std::string& name, JS::HandleValue value); | ||||
static IComponent* Script_QueryInterface(ScriptInterface::CxPrivate* pCxPrivate, int ent, int iid); | IComponent* Script_QueryInterface(int ent, int iid); | ||||
static std::vector<int> Script_GetEntitiesWithInterface(ScriptInterface::CxPrivate* pCxPrivate, int iid); | std::vector<int> Script_GetEntitiesWithInterface(int iid); | ||||
static std::vector<IComponent*> Script_GetComponentsWithInterface(ScriptInterface::CxPrivate* pCxPrivate, int iid); | std::vector<IComponent*> Script_GetComponentsWithInterface(int iid); | ||||
static void Script_PostMessage(ScriptInterface::CxPrivate* pCxPrivate, int ent, int mtid, JS::HandleValue data); | void Script_PostMessage(int ent, int mtid, JS::HandleValue data); | ||||
static void Script_BroadcastMessage(ScriptInterface::CxPrivate* pCxPrivate, int mtid, JS::HandleValue data); | void Script_BroadcastMessage(int mtid, JS::HandleValue data); | ||||
static int Script_AddEntity(ScriptInterface::CxPrivate* pCxPrivate, const std::string& templateName); | int Script_AddEntity(const std::string& templateName); | ||||
static int Script_AddLocalEntity(ScriptInterface::CxPrivate* pCxPrivate, const std::string& templateName); | int Script_AddLocalEntity(const std::string& templateName); | ||||
static void Script_DestroyEntity(ScriptInterface::CxPrivate* pCxPrivate, int ent); | void Script_DestroyEntity(int ent); | ||||
static void Script_FlushDestroyedEntities(ScriptInterface::CxPrivate* pCxPrivate); | void Script_FlushDestroyedEntities(); | ||||
private: | |||||
CMessage* ConstructMessage(int mtid, JS::HandleValue data); | CMessage* ConstructMessage(int mtid, JS::HandleValue data); | ||||
void SendGlobalMessage(entity_id_t ent, const CMessage& msg); | void SendGlobalMessage(entity_id_t ent, const CMessage& msg); | ||||
void FlattenDynamicSubscriptions(); | void FlattenDynamicSubscriptions(); | ||||
void RemoveComponentDynamicSubscriptions(IComponent* component); | void RemoveComponentDynamicSubscriptions(IComponent* component); | ||||
ComponentTypeId GetScriptWrapper(InterfaceId iid); | ComponentTypeId GetScriptWrapper(InterfaceId iid); | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator