DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
DoOnce.c
См. документацию.
1class DoOnce
2{
3 protected static ref map<string, bool> m_Done;
4
5 protected static void Ensure()
6 {
7 if (!m_Done)
9 }
10
11 // Returns true only on the first successful execution during this runtime.
12 static bool Run(string key, Class target, string fnName, Param params = null)
13 {
14 Ensure();
15
16 if (!key || !target || !fnName)
17 return false;
18
19 if (m_Done.Contains(key))
20 return false;
21
22 m_Done.Set(key, true);
23
24 // Call any method on any object by name
25 bool called = g_Game.GameScript.CallFunctionParams(target, fnName, null, params);
26
27 return called;
28 }
29
30 static bool HasRun(string key)
31 {
32 Ensure();
33
34 return m_Done.Contains(key);
35 }
36
37 static void Clear(string key)
38 {
39 Ensure();
40
41 if (m_Done.Contains(key))
42 m_Done.Remove(key);
43 }
44}
DayZGame g_Game
Определения DayZGame.c:4074
Super root of all classes in Enforce script.
Определения EnScript.c:11
static void Ensure()
Определения DoOnce.c:5
static ref map< string, bool > m_Done
Определения DoOnce.c:3
static void Clear(string key)
Определения DoOnce.c:37
static bool Run(string key, Class target, string fnName, Param params=null)
Определения DoOnce.c:12
static bool HasRun(string key)
Определения DoOnce.c:30
Определения DoOnce.c:2
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Определения param.c:12
Определения Transport.c:70