PC Stable Documentation
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
tools.c File Reference

Data Structures

class  ScriptCallQueue
 ScriptCallQueue Class provide "lazy" calls - when we don't want to execute function immediately but later during frame update (used mainly in UI)
usage: More...
 
class  ScriptInvoker
 ScriptInvoker Class provide list of callbacks
usage: More...
 

Enumerations

enum  EScriptInvokerInsertFlags
 

Functions

enum EScriptInvokerInsertFlags ScriptCaller ()
 Designed to hold 1 valid call.
 
static proto ScriptCaller Create (func fn)
 Creates a ScriptCaller.
 
proto void Init (func fn)
 Replaces the current registered func with the new one, throws errors if unsuccessful.
 
proto void Invoke (void param1=null, void param2=null, void param3=null, void param4=null, void param5=null, void param6=null, void param7=null, void param8=null, void param9=null)
 Invoke call on the registered func, throws errors if unsuccessful.
 
proto bool IsValid ()
 Checks if the ScriptCaller is valid.
 
proto bool Equals (notnull ScriptCaller other)
 Compares this script caller against another script caller.
 

Variables

enum EScriptInvokerInsertFlags NONE
 
enum EScriptInvokerInsertFlags ALL
 Default flag.
 
 IMMEDIATE
 It gets added in immediately, which means that when called while an invoker is running, it will call this newly added call in the same run.
 
 UNIQUE
 Only one call to this instance+method is ever expected.
 

Enumeration Type Documentation

◆ EScriptInvokerInsertFlags

Function Documentation

◆ Create()

static proto ScriptCaller Create ( func  fn)
static

Creates a ScriptCaller.

◆ Equals()

proto bool Equals ( notnull ScriptCaller  other)

Compares this script caller against another script caller.

Note
May return true even if either one is invalid
class SomeClass
{
void SomeMethod()
{
}
}
void Test()
{
SomeClass instanceA = new SomeClass();
SomeClass instanceB = new SomeClass();
ScriptCaller callerA;
ScriptCaller callerB;
callerA = ScriptCaller.Create(instanceA.SomeMethod);
callerB = ScriptCaller.Create(instanceA.SomeMethod);
Print(callerA.Equals(callerB));
Print(callerA == callerB);
Print(callerA);
Print(callerB);
callerA = ScriptCaller.Create(instanceA.SomeMethod);
callerB = ScriptCaller.Create(instanceB.SomeMethod);
Print(callerA.Equals(callerB));
Print(callerA == callerB);
Print(callerA);
Print(callerB);
}
enum EScriptInvokerInsertFlags ScriptCaller()
Designed to hold 1 valid call.
Attribute used for tests annotation and assignment to Suites.
Definition TestingFramework.c:97
proto void Print(void var)
Prints content of variable to console/log.

◆ Init()

proto void Init ( func  fn)

Replaces the current registered func with the new one, throws errors if unsuccessful.

◆ Invoke()

proto void Invoke ( void  param1 = null,
void  param2 = null,
void  param3 = null,
void  param4 = null,
void  param5 = null,
void  param6 = null,
void  param7 = null,
void  param8 = null,
void  param9 = null 
)

Invoke call on the registered func, throws errors if unsuccessful.

◆ IsValid()

override bool IsValid ( )

Checks if the ScriptCaller is valid.

Checks if the ScriptCaller is valid.

References Debug::Log(), and spawnWeight.

◆ ScriptCaller()

enum EScriptInvokerInsertFlags ScriptCaller ( )

Designed to hold 1 valid call.

ScriptCaller is meant to be created through Create

Variable Documentation

◆ ALL

Default flag.

Note
Don't use this if you want it to remove only the last insert instead of all of them

◆ IMMEDIATE

IMMEDIATE

It gets added in immediately, which means that when called while an invoker is running, it will call this newly added call in the same run.

Note
Default flag, as that is the original behaviour, although it might cause endless Insert chain now... (still better than undefined behaviour)
In case of "Possible endless Insert detected" VME, either create an exit, remove the IMMEDIATE flag or make the insert UNIQUE
The Endless Insert is detected by seeing if "amount of calls > initial size + 128"

◆ NONE

@ NONE

◆ UNIQUE

UNIQUE

Only one call to this instance+method is ever expected.

Note
Will throw a VME when a second one is attempted to be added
If it was already added without the flag, it will also throw a VME and keep the first of all previously inserted