ScriptInvoker Class provide list of callbacks
usage:
class Player
{
void OnKilled()
{
m_DeathInvoker.Invoke(this);
}
}
void LogPlayerDeath(p)
{
}
class Game
{
void RemovePlayer(Player p)
{
}
void GameOver()
{
}
}
void OnPlayerSpaned(Player p)
{
p.m_DeathInvoker.Insert(LogPlayerDeath);
p.m_DeathInvoker.Insert(game.RemovePlayer);
p.m_DeathInvoker.Insert(game.GameOver);
}
Definition at line 115 of file tools.c.