DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл tools.c

См. исходные тексты.

Структуры данных

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: Подробнее...
 
class  ScriptInvoker
 ScriptInvoker Class provide list of callbacks
usage: Подробнее...
 

Перечисления

enum  EScriptInvokerInsertFlags
 

Функции

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.
 

Переменные

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.
 

Перечисления

◆ EScriptInvokerInsertFlags

130{
131 NONE,
137
138 IMMEDIATE,
143
144 UNIQUE,
145}
IMMEDIATE
It gets added in immediately, which means that when called while an invoker is running,...
Definition tools.c:7
UNIQUE
Only one call to this instance+method is ever expected.
Definition tools.c:13
enum EScriptInvokerInsertFlags NONE
Definition tools.c:0

Функции

◆ 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.

Заметки
May return true even if either one is invalid
class SomeClass
{
void SomeMethod()
{
}
}
void Test()
{
callerA = ScriptCaller.Create(instanceA.SomeMethod);
callerB = ScriptCaller.Create(instanceA.SomeMethod);
Print(callerA.Equals(callerB));
callerA = ScriptCaller.Create(instanceA.SomeMethod);
callerB = ScriptCaller.Create(instanceB.SomeMethod);
Print(callerA.Equals(callerB));
}
enum EScriptInvokerInsertFlags ScriptCaller()
Designed to hold 1 valid call.
Definition EntityAI.c:95
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.

135 {
136 if (!super.IsValid())
137 return false;
138
139 if (spawnWeight < 1)
140 {
141 Debug.Log("Invalid spawnWeight set for a discrete item set!","n/a","Validation","PlayerSpawnPresetDiscreteItemSetBase");
142 return false;
143 }
144 return true;
145 }
PlayerSpawnPresetItemSetBase spawnWeight
Definition Debug.c:14
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:136

Перекрестные ссылки discreteItemSets, Debug::Log(), m_IsValid, slotName и spawnWeight.

◆ ScriptCaller()

enum EScriptInvokerInsertFlags ScriptCaller ( )

Designed to hold 1 valid call.

ScriptCaller is meant to be created through Create

Переменные

◆ ALL

Default flag.

Заметки
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.

Заметки
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.

Заметки
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