Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/system/ComponentManager.cpp
Show All 25 Lines | |||||
#include "simulation2/MessageTypes.h" | #include "simulation2/MessageTypes.h" | ||||
#include "simulation2/components/ICmpTemplateManager.h" | #include "simulation2/components/ICmpTemplateManager.h" | ||||
#include "lib/utf8.h" | #include "lib/utf8.h" | ||||
#include "ps/CLogger.h" | #include "ps/CLogger.h" | ||||
#include "ps/Filesystem.h" | #include "ps/Filesystem.h" | ||||
#include "ps/scripting/JSInterface_VFS.h" | #include "ps/scripting/JSInterface_VFS.h" | ||||
#include "simulation2/scripting/JSInterface_Simulation.h" | |||||
wraitii: unnecessary also | |||||
/** | /** | ||||
* Used for script-only message types. | * Used for script-only message types. | ||||
*/ | */ | ||||
class CMessageScripted : public CMessage | class CMessageScripted : public CMessage | ||||
{ | { | ||||
public: | public: | ||||
virtual int GetType() const { return mtid; } | virtual int GetType() const { return mtid; } | ||||
Show All 22 Lines | CComponentManager::CComponentManager(CSimContext& context, shared_ptr<ScriptRuntime> rt, bool skipScriptFunctions) : | ||||
m_ScriptInterface.SetCallbackData(static_cast<void*> (this)); | m_ScriptInterface.SetCallbackData(static_cast<void*> (this)); | ||||
m_ScriptInterface.ReplaceNondeterministicRNG(m_RNG); | m_ScriptInterface.ReplaceNondeterministicRNG(m_RNG); | ||||
// For component script tests, the test system sets up its own scripted implementation of | // For component script tests, the test system sets up its own scripted implementation of | ||||
// these functions, so we skip registering them here in those cases | // these functions, so we skip registering them here in those cases | ||||
if (!skipScriptFunctions) | if (!skipScriptFunctions) | ||||
{ | { | ||||
JSI_VFS::RegisterScriptFunctions_Simulation(m_ScriptInterface); | JSI_VFS::RegisterScriptFunctions_Simulation(m_ScriptInterface); | ||||
m_ScriptInterface.RegisterFunction<JS::Value, JSI_Simulation::GetInitAttributes>("GetInitAttributes"); | |||||
Done Inline Actionsnot needed from what I can tell wraitii: not needed from what I can tell | |||||
m_ScriptInterface.RegisterFunction<void, int, std::string, JS::HandleValue, CComponentManager::Script_RegisterComponentType> ("RegisterComponentType"); | m_ScriptInterface.RegisterFunction<void, int, std::string, JS::HandleValue, CComponentManager::Script_RegisterComponentType> ("RegisterComponentType"); | ||||
m_ScriptInterface.RegisterFunction<void, int, std::string, JS::HandleValue, CComponentManager::Script_RegisterSystemComponentType> ("RegisterSystemComponentType"); | m_ScriptInterface.RegisterFunction<void, int, std::string, JS::HandleValue, CComponentManager::Script_RegisterSystemComponentType> ("RegisterSystemComponentType"); | ||||
m_ScriptInterface.RegisterFunction<void, int, std::string, JS::HandleValue, CComponentManager::Script_ReRegisterComponentType> ("ReRegisterComponentType"); | m_ScriptInterface.RegisterFunction<void, int, std::string, JS::HandleValue, CComponentManager::Script_ReRegisterComponentType> ("ReRegisterComponentType"); | ||||
m_ScriptInterface.RegisterFunction<void, std::string, CComponentManager::Script_RegisterInterface> ("RegisterInterface"); | m_ScriptInterface.RegisterFunction<void, std::string, CComponentManager::Script_RegisterInterface> ("RegisterInterface"); | ||||
m_ScriptInterface.RegisterFunction<void, std::string, CComponentManager::Script_RegisterMessageType> ("RegisterMessageType"); | m_ScriptInterface.RegisterFunction<void, std::string, CComponentManager::Script_RegisterMessageType> ("RegisterMessageType"); | ||||
m_ScriptInterface.RegisterFunction<void, std::string, JS::HandleValue, CComponentManager::Script_RegisterGlobal> ("RegisterGlobal"); | m_ScriptInterface.RegisterFunction<void, std::string, JS::HandleValue, CComponentManager::Script_RegisterGlobal> ("RegisterGlobal"); | ||||
m_ScriptInterface.RegisterFunction<IComponent*, int, int, CComponentManager::Script_QueryInterface> ("QueryInterface"); | m_ScriptInterface.RegisterFunction<IComponent*, int, int, CComponentManager::Script_QueryInterface> ("QueryInterface"); | ||||
m_ScriptInterface.RegisterFunction<std::vector<int>, int, CComponentManager::Script_GetEntitiesWithInterface> ("GetEntitiesWithInterface"); | m_ScriptInterface.RegisterFunction<std::vector<int>, int, CComponentManager::Script_GetEntitiesWithInterface> ("GetEntitiesWithInterface"); | ||||
▲ Show 20 Lines • Show All 1,095 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
unnecessary also