Difference between revisions of "NET:LavishScriptAPI.LavishScriptObject"

From Lavish Software Wiki
Jump to navigation Jump to search
Line 8: Line 8:
 
* public [[NET:LavishScriptAPI.LavishScriptObject.LavishScriptObject|LavishScriptObject]](LavishScriptObject Copy) -- copy constructor
 
* public [[NET:LavishScriptAPI.LavishScriptObject.LavishScriptObject|LavishScriptObject]](LavishScriptObject Copy) -- copy constructor
 
* public LavishScriptObject [[NET:LavishScriptAPI.LavishScriptObject.GetMember|GetMember]](string Member)
 
* public LavishScriptObject [[NET:LavishScriptAPI.LavishScriptObject.GetMember|GetMember]](string Member)
* public LavishScriptObject [[NET:LavishScriptAPI.LavishScriptObject.GetMember|GetMember]](string Member, string[] args)
+
* public LavishScriptObject [[NET:LavishScriptAPI.LavishScriptObject.GetMember|GetMember]](string Member, params string[] args)
* public LavishScriptObject [[NET:LavishScriptAPI.LavishScriptObject.GetIndex|GetIndex]](string[] args)
+
* public LavishScriptObject [[NET:LavishScriptAPI.LavishScriptObject.GetIndex|GetIndex]](params string[] args)
 
* public bool [[NET:LavishScriptAPI.LavishScriptObject.ExecuteMethod|ExecuteMethod]](string Method)
 
* public bool [[NET:LavishScriptAPI.LavishScriptObject.ExecuteMethod|ExecuteMethod]](string Method)
* public bool [[NET:LavishScriptAPI.LavishScriptObject.ExecuteMethod|ExecuteMethod]](string Method, string[] args)
+
* public bool [[NET:LavishScriptAPI.LavishScriptObject.ExecuteMethod|ExecuteMethod]](string Method, params string[] args)
 
* public T [[NET:LavishScriptAPI.LavishScriptObject.GetValue|GetValue]]<T>()
 
* public T [[NET:LavishScriptAPI.LavishScriptObject.GetValue|GetValue]]<T>()
 
* public override string ToString() -- same as GetValue<string>
 
* public override string ToString() -- same as GetValue<string>

Revision as of 22:53, 16 December 2006

Overview

The LavishScriptObject class holds object information for the remaining duration of the current frame. You must use frame locking to ensure that the object is valid for the duration of usage. After the frame completes, the LavishScriptObject's internal data will be invalidated automatically, and usage of its methods will fail. LavishScriptObjects can be retrieved by LavishScript.Objects.GetObject, LavishScriptObject.GetMember, LavishScriptObject.GetIndex and LavishScriptObject.GetLSType (and by inference, any functions that call these functions and return a retrieved object...).

Subclassing

The LavishScriptObject class provides a base class from which to create .NET equivalents for LavishScript objects. Every LavishScript object can be represented by a .NET object. The data inside a LavishScriptObject is a black box, and that black box will be destroyed at the end of a frame, causing its members to return a null or default value -- except for permanent objects and objects created by you. It is perfectly safe to copy a LavishScriptObject, and a copy constructor is provided that accepts a LavishScriptObject parameter, for which null is a valid value. The data stored in the black box is a token representing the object data (either the value for a value type, or a reference for a reference type), and a token representing the object type (such as string, int, collection, and so on). Because the real type is stored in the black box, it is reasonably safe to attempt to access LavishScript object members and methods as if it were any LavishScript type.

Members

See Also

Inner Space .NET