Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/simulation2/components/ICmpAIManager.cpp
Show All 33 Lines | |||||
// that can be loaded via AddPlayer: | // that can be loaded via AddPlayer: | ||||
struct GetAIsHelper | struct GetAIsHelper | ||||
{ | { | ||||
NONCOPYABLE(GetAIsHelper); | NONCOPYABLE(GetAIsHelper); | ||||
public: | public: | ||||
GetAIsHelper(const ScriptInterface& scriptInterface) : | GetAIsHelper(const ScriptInterface& scriptInterface) : | ||||
m_ScriptInterface(scriptInterface), | m_ScriptInterface(scriptInterface), | ||||
m_AIs(scriptInterface.GetJSRuntime()) | m_AIs(scriptInterface.GetGeneralJSContext()) | ||||
{ | { | ||||
ScriptRequest rq(m_ScriptInterface); | ScriptRequest rq(m_ScriptInterface); | ||||
m_AIs = JS_NewArrayObject(rq.cx, 0); | m_AIs = JS_NewArrayObject(rq.cx, 0); | ||||
} | } | ||||
void Run() | void Run() | ||||
{ | { | ||||
vfs::ForEachFile(g_VFS, L"simulation/ai/", Callback, (uintptr_t)this, L"*.json", vfs::DIR_RECURSIVE); | vfs::ForEachFile(g_VFS, L"simulation/ai/", Callback, (uintptr_t)this, L"*.json", vfs::DIR_RECURSIVE); | ||||
Show All 37 Lines |
Wildfire Games · Phabricator