Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/simulation2/system/ComponentManager.h
Show First 20 Lines • Show All 109 Lines • ▼ Show 20 Lines | ComponentType(ComponentType&& other) | ||||
alloc = std::move(other.alloc); | alloc = std::move(other.alloc); | ||||
dealloc = std::move(other.dealloc); | dealloc = std::move(other.dealloc); | ||||
name = std::move(other.name); | name = std::move(other.name); | ||||
schema = std::move(other.schema); | schema = std::move(other.schema); | ||||
ctor = std::move(other.ctor); | ctor = std::move(other.ctor); | ||||
} | } | ||||
}; | }; | ||||
struct FindJSONFilesCallbackData | |||||
{ | |||||
VfsPath path; | |||||
std::vector<std::string> templates; | |||||
}; | |||||
public: | public: | ||||
CComponentManager(CSimContext&, shared_ptr<ScriptRuntime> rt, bool skipScriptFunctions = false); | CComponentManager(CSimContext&, shared_ptr<ScriptRuntime> rt, bool skipScriptFunctions = false); | ||||
~CComponentManager(); | ~CComponentManager(); | ||||
void LoadComponentTypes(); | void LoadComponentTypes(); | ||||
/** | /** | ||||
* Load a script and execute it in a new function scope. | * Load a script and execute it in a new function scope. | ||||
▲ Show 20 Lines • Show All 196 Lines • ▼ Show 20 Lines | private: | ||||
static std::vector<IComponent*> Script_GetComponentsWithInterface(ScriptInterface::CxPrivate* pCxPrivate, int iid); | static std::vector<IComponent*> Script_GetComponentsWithInterface(ScriptInterface::CxPrivate* pCxPrivate, int iid); | ||||
static void Script_PostMessage(ScriptInterface::CxPrivate* pCxPrivate, int ent, int mtid, JS::HandleValue data); | static void Script_PostMessage(ScriptInterface::CxPrivate* pCxPrivate, int ent, int mtid, JS::HandleValue data); | ||||
static void Script_BroadcastMessage(ScriptInterface::CxPrivate* pCxPrivate, int mtid, JS::HandleValue data); | static void Script_BroadcastMessage(ScriptInterface::CxPrivate* pCxPrivate, int mtid, JS::HandleValue data); | ||||
static int Script_AddEntity(ScriptInterface::CxPrivate* pCxPrivate, const std::string& templateName); | static int Script_AddEntity(ScriptInterface::CxPrivate* pCxPrivate, const std::string& templateName); | ||||
static int Script_AddLocalEntity(ScriptInterface::CxPrivate* pCxPrivate, const std::string& templateName); | static int Script_AddLocalEntity(ScriptInterface::CxPrivate* pCxPrivate, const std::string& templateName); | ||||
static void Script_DestroyEntity(ScriptInterface::CxPrivate* pCxPrivate, int ent); | static void Script_DestroyEntity(ScriptInterface::CxPrivate* pCxPrivate, int ent); | ||||
static void Script_FlushDestroyedEntities(ScriptInterface::CxPrivate* pCxPrivate); | static void Script_FlushDestroyedEntities(ScriptInterface::CxPrivate* pCxPrivate); | ||||
static bool Script_DataFileExists(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& fileName); | static bool Script_DataFileExists(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& fileName); | ||||
static std::vector<std::string> Script_FindJSONFiles(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& subPath, bool recursive); | |||||
// callback function to handle recursively finding files in a directory | |||||
static Status FindJSONFilesCallback(const VfsPath&, const CFileInfo&, const uintptr_t); | |||||
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 43 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator