Loading...
Searching...
No Matches
ScriptInvokerBase Interface Template Reference

ScriptInvoker Class provide list of callbacks
usage: More...

Inheritance diagram for ScriptInvokerBase:
Managed

Public Member Functions

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 all inserted methods with given arguments.
 
proto void Insert (T fn)
 Insert method to list.
 
proto void Remove (T fn)
 Remove specific call from list.
 
proto native void Clear ()
 Remove all calls from list.
 
proto native void Dump ()
 Dump all callbacks into debug log.
 
- Public Member Functions inherited from Managed
proto external ref Managed Clone ()
 Return shallow copy of object, or null if it is not allowed (not public constructor)
 

Detailed Description

ScriptInvoker Class provide list of callbacks
usage:

class Player
{
ref ScriptInvoker m_DeathInvoker = new ScriptInvoker();
void OnKilled()
{
m_DeathInvoker.Invoke(this);
}
}
void LogPlayerDeath(p)
{
Print("RIP " + p);
}
class Game
{
void RemovePlayer(Player p)
{
}
void GameOver()
{
}
}
void OnPlayerSpaned(Player p)
{
Game game = g_Game;
p.m_DeathInvoker.Insert(LogPlayerDeath);
p.m_DeathInvoker.Insert(game.RemovePlayer);
p.m_DeathInvoker.Insert(game.GameOver);
}
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.

Member Function Documentation

◆ Clear()

proto native void ScriptInvokerBase.Clear ( )

Remove all calls from list.

◆ Dump()

proto native void ScriptInvokerBase.Dump ( )

Dump all callbacks into debug log.

Warning
Log level must be set at last to DEBUG level ('-logLevel debug' in CLI) to see debug logs.

◆ Insert()

proto void ScriptInvokerBase.Insert ( T fn)

Insert method to list.

◆ Invoke()

proto void ScriptInvokerBase.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 all inserted methods with given arguments.

◆ Remove()

proto void ScriptInvokerBase.Remove ( T fn)

Remove specific call from list.


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