Enfusion Script API
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
BaseContainerTools Interface Reference

Static Public Member Functions

static proto bool WriteToWidget (BaseContainer cont, Widget w, string varName)
 
static proto bool ReadFromWidget (BaseContainer cont, Widget w, string varName)
 
static proto void WriteToInstance (notnull Class inst, BaseContainer src)
 
static proto void ReadFromInstance (notnull Class inst, BaseContainer src)
 
static proto ref Resource LoadContainer (ResourceName resourceName)
 Load BaseContainer from file.
 
static proto ref Resource CreateContainer (string typeClass)
 Create BaseContainer from object.
 
static proto bool SaveContainer (BaseContainer cont, ResourceName resourceName, string fileName="")
 Save BaseContainer to file.
 
static proto ref Resource CreateContainerFromInstance (notnull Managed instance)
 Create BaseContainer from object.
 
static proto ref Managed CreateInstanceFromContainer (BaseContainer src)
 Create object from BaseContainer.
 

Member Function Documentation

◆ CreateContainer()

static proto ref Resource BaseContainerTools.CreateContainer ( string  typeClass)
static

Create BaseContainer from object.

class TestingClass
{
float m_float1;
float m_float2;
};
Resource holder = BaseContainerTools.CreateContainer("TestingClass");
if (holder)
{
}
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
Definition: attributes.c:259
An Attribute for BaseContainer.
Definition: attributes.c:381
Definition: BaseContainerTools.c:13
static proto ref Resource CreateContainer(string typeClass)
Create BaseContainer from object.
Definition: BaseContainer.c:13
proto external string GetClassName()
proto external BaseContainer ToBaseContainer()
Object hoding reference to resource.
Definition: Resource.c:25
proto external BaseResourceObject GetResource()

◆ CreateContainerFromInstance()

static proto ref Resource BaseContainerTools.CreateContainerFromInstance ( notnull Managed  instance)
static

Create BaseContainer from object.

class TestingClass
{
float m_float1;
float m_float2;
};
// save config
TestingClass obj = new TestingClass();
obj.m_float1 = 654.1;
obj.m_float2 = 996.9;
// save config
if (holder)
{
BaseContainerTools.SaveContainer(holder.GetResource().ToBaseContainer(), "{86C36D99914265F8}test.conf");
}
static proto ref Resource CreateContainerFromInstance(notnull Managed instance)
Create BaseContainer from object.
static proto bool SaveContainer(BaseContainer cont, ResourceName resourceName, string fileName="")
Save BaseContainer to file.

◆ CreateInstanceFromContainer()

static proto ref Managed BaseContainerTools.CreateInstanceFromContainer ( BaseContainer  src)
static

Create object from BaseContainer.

class TestingClass
{
float m_float1;
float m_float2;
};
// load config
Resource holder = BaseContainerTools.LoadContainer("{86C36D99914265F8}test.conf");
if (holder)
{
TestingClass obj = TestingClass.Cast(BaseContainerTools.CreateInstanceFromContainer(holder.GetResource().ToBaseContainer()));
if (obj)
{
Print(obj.m_float1);
Print(obj.m_float2);
}
}
static proto ref Resource LoadContainer(ResourceName resourceName)
Load BaseContainer from file.
static proto ref Managed CreateInstanceFromContainer(BaseContainer src)
Create object from BaseContainer.

◆ LoadContainer()

static proto ref Resource BaseContainerTools.LoadContainer ( ResourceName  resourceName)
static

Load BaseContainer from file.

// load config
Resource holder = BaseContainerTools.LoadContainer("{86C36D99914265F8}test.conf");
if (holder)
{
}

◆ ReadFromInstance()

static proto void BaseContainerTools.ReadFromInstance ( notnull Class  inst,
BaseContainer  src 
)
static

◆ ReadFromWidget()

static proto bool BaseContainerTools.ReadFromWidget ( BaseContainer  cont,
Widget  w,
string  varName 
)
static

◆ SaveContainer()

static proto bool BaseContainerTools.SaveContainer ( BaseContainer  cont,
ResourceName  resourceName,
string  fileName = "" 
)
static

Save BaseContainer to file.

class TestingClass
{
float m_float1;
float m_float2;
};
// save config
TestingClass obj = new TestingClass();
obj.m_float1 = 654.1;
obj.m_float2 = 996.9;
// save config
if (holder)
{
BaseContainerTools.SaveContainer(holder.GetResource().ToBaseContainer(), "{86C36D99914265F8}test.conf");
}

◆ WriteToInstance()

static proto void BaseContainerTools.WriteToInstance ( notnull Class  inst,
BaseContainer  src 
)
static

◆ WriteToWidget()

static proto bool BaseContainerTools.WriteToWidget ( BaseContainer  cont,
Widget  w,
string  varName 
)
static

The documentation for this interface was generated from the following file: