Property bags

SSharp S# API

DropDown image DropDownHover image Collapse image Expand image CollapseAll image ExpandAll image Copy image CopyHover image

S# has internal notion of property bags. A property bag is a special kind of object which is composed of (name,value) pairs. Any property may be accessed via standard syntax object.PropertName.

Syntactically property bag may be created as following:

 

vector3d = [

    x -> 2,

    y -> 3,

    z -> -2 

];

 

After property bag was created it is possible to introduce new property to it:

 vector3d.name = "my vector";

 

Underlying .NET property bag class should implement IScriptable interface. By default such class is called Expando, and specified by the following setting in runtime configuration:

 <Item id="ScriptableObjectType" value="Scripting.SSharp.Runtime.Promotion.Expando" />

It is of course possible to replace default implementation by custom.