Difference between revisions of "NET:LavishScriptAPI.LavishScriptObject"

From Lavish Software Wiki
Jump to navigation Jump to search
 
Line 16: Line 16:
 
* public LavishScriptObject [[NET:LavishScriptAPI.LavishScriptObject.GetLSType|GetLSType]]()
 
* public LavishScriptObject [[NET:LavishScriptAPI.LavishScriptObject.GetLSType|GetLSType]]()
 
* public T [[NET:LavishScriptAPI.LavishScriptObject.GetLSType|GetLSType]]<T>()
 
* public T [[NET:LavishScriptAPI.LavishScriptObject.GetLSType|GetLSType]]<T>()
 +
* public string [[NET:LavishScriptAPI.LavishScriptObject.GetLSReference|GetLSReference]]()
  
 
== See Also ==
 
== See Also ==
 
[[IS:.NET|Inner Space .NET]]
 
[[IS:.NET|Inner Space .NET]]

Revision as of 19:24, 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