Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
ScriptInvoker Class Reference

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

Private Member Functions

proto native void Clear ()
 remove all calls from list
proto int Count (func fn)
 count how many times this fn is actively present in the Invoker
proto bool Insert (func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
 insert method to list
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 bool Remove (func fn, int flags=EScriptInvokerRemoveFlags.ALL)
 remove specific call from list

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);
}
ScriptInvoker Class provide list of callbacks usage:
Definition tools.c:116
DayZGame g_Game
Definition dayzgame.c:3942
proto void Print(void var)
Prints content of variable to console/log.

Definition at line 115 of file tools.c.

Member Function Documentation

◆ Clear()

proto native void Clear ( )
private

remove all calls from list

◆ Count()

proto int Count ( func fn)
private

count how many times this fn is actively present in the Invoker

◆ Insert()

◆ 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 )
private

◆ Remove()


The documentation for this class was generated from the following file:
  • F:/Games/Dayz/scripts/2_gamelib/tools.c