mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Split off Object-related functions from ScriptInterface
Follows 34b1920e7b.
This splits off the object-related functions, such as
[Set/Get/Has]Property, CreateObject, CreateArray, FreezeObject.
It also puts the definitions in the header itself, which might end up
with faster code here & there, though perhaps slower compilation time
(somewhat doubtful since we already included most things anyways).
Differential Revision: https://code.wildfiregames.com/D3956
This was SVN commit r25430.
This commit is contained in:
@@ -390,20 +390,20 @@ void CNetClient::PostPlayerAssignmentsToScript()
|
||||
ScriptRequest rq(GetScriptInterface());
|
||||
|
||||
JS::RootedValue newAssignments(rq.cx);
|
||||
ScriptInterface::CreateObject(rq, &newAssignments);
|
||||
Script::CreateObject(rq, &newAssignments);
|
||||
|
||||
for (const std::pair<const CStr, PlayerAssignment>& p : m_PlayerAssignments)
|
||||
{
|
||||
JS::RootedValue assignment(rq.cx);
|
||||
|
||||
ScriptInterface::CreateObject(
|
||||
Script::CreateObject(
|
||||
rq,
|
||||
&assignment,
|
||||
"name", p.second.m_Name,
|
||||
"player", p.second.m_PlayerID,
|
||||
"status", p.second.m_Status);
|
||||
|
||||
GetScriptInterface().SetProperty(newAssignments, p.first.c_str(), assignment);
|
||||
Script::SetProperty(rq, newAssignments, p.first.c_str(), assignment);
|
||||
}
|
||||
|
||||
PushGuiMessage(
|
||||
|
||||
Reference in New Issue
Block a user