18 #include "precompiled.h"
26 m_ScriptInterface(scriptInterface), m_Instance(
CScriptValRooted(scriptInterface.GetContext(), instance))
60 LOGERROR(L
"Script message handler %hs failed", name);
75 LOGERROR(L
"Script Serialize call failed");
97 LOGERROR(L
"Script Deserialize call failed");
An entity initialisation parameter node.
jsval ToJSValCached(ScriptInterface &) const
virtual void ScriptObjectAppend(const char *name, jsval &obj)=0
Deserialize an object jsval, appending properties to object 'obj'.
bool HasProperty(jsval obj, const char *name)
Check the named property has been defined on the given object.
Serialization interface; see serialization overview.
CComponentTypeScript(ScriptInterface &scriptInterface, jsval instance)
bool m_HasCustomSerialize
bool CallFunctionVoid(jsval val, const char *name)
Call the named property on the given object, with void return type and 0 arguments.
const jsval & get() const
Returns the current value.
A trivial wrapper around a jsval.
void ScriptVal(const char *name, jsval value)
Serialize a jsval.
void Serialize(ISerializer &serialize)
void Deserialize(const CParamNode ¶mNode, IDeserializer &deserialize, entity_id_t ent)
bool m_HasCustomDeserialize
bool GetProperty(jsval obj, const char *name, T &out)
Get the named property on the given object.
bool CallFunction(jsval val, const char *name, R &ret)
Call the named property on the given object, with return type R and 0 arguments.
virtual void ScriptVal(const char *name, jsval &out)=0
Deserialize a jsval, replacing 'out'.
virtual const char * GetScriptGlobalHandlerName() const =0
ScriptInterface & m_ScriptInterface
jsval & getRef() const
Returns reference to the current value.
jsval get() const
Returns the current value (or JSVAL_VOID if uninitialised).
virtual const char * GetScriptHandlerName() const =0
Abstraction around a SpiderMonkey JSContext.
CScriptValRooted m_Instance
bool SetProperty(jsval obj, const char *name, const T &value, bool constant=false, bool enumerate=true)
Set the named property on the given object.
u32 entity_id_t
Entity ID type.
void HandleMessage(const CMessage &msg, bool global)
void Init(const CParamNode ¶mNode, entity_id_t ent)
Deserialization interface; see serialization overview.