DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс array< ref CallQueueContext >

CallQueue Class provide "lazy" calls - when we don't want to execute function immediately but later during frame update (used mainly in UI)
usage: Подробнее...

Закрытые члены

void CallQueue ()
 
void Tick ()
 System function, don't call it.
 
void Call (Class obj, string fn_name, Param params=NULL)
 Creates new call request, add it on queue and execute during frame update (depends on call category)
 
void RemoveCalls (Class obj)
 Removes all queued calls for object (call this function when object is going to be deleted)
 

Закрытые данные

bool m_processing
 

Подробное описание

CallQueue Class provide "lazy" calls - when we don't want to execute function immediately but later during frame update (used mainly in UI)
usage:

GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(this, "Refresh"); // calls "Refresh" function on "this" with no arguments
GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(this, "Show", new Param1<bool>(true)); // calls "Show" function on "this" with one bool argument
GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(this, "SetPos", new Param2<float, float>(0.2, 0.5)); // calls "SetPos" function on "this" with two float arguments
Definition EntityAI.c:95
proto native CGame GetGame()
const int CALL_CATEGORY_GUI
Definition tools.c:9

Методы

◆ Call()

void Call ( Class obj,
string fn_name,
Param params = NULL )
inlineprivate

Creates new call request, add it on queue and execute during frame update (depends on call category)

Аргументы
objtarget object on which function will be executed
fn_namename of function (on object "obj") which will be executed
paramsfunction arguments see Param for usage, default NULL (no arguments)
Предупреждения
When object "obj" is deleted prior call execution, don't forget to remove calls for this object with RemoveCalls
109 {
110 Insert(new CallQueueContext(obj, fn_name, params));
111 }
Definition tools.c:16

◆ CallQueue()

void CallQueue ( )
inlineprivate
71 {
72 m_processing = false;
73 }
bool m_processing
Definition tools.c:68

◆ RemoveCalls()

void RemoveCalls ( Class obj)
inlineprivate

Removes all queued calls for object (call this function when object is going to be deleted)

Аргументы
objobject for which you want remove all "lazy" calls
119 {
120 if (Count())
121 {
122 for (int i = Count() - 1; i >= 0; i--)
123 {
125 if (ctx.m_target == obj)
126 {
127 ctx.Invalidate();
128 }
129 }
130 }
131 }
override float Get()
Definition PlayerStatBase.c:137
@ Count
Definition RandomGeneratorSyncManager.c:8

Перекрестные ссылки Count, Get(), CallQueueContext::Invalidate() и CallQueueContext::m_target.

◆ Tick()

void Tick ( )
inlineprivate

System function, don't call it.

79 {
80 if (m_processing) return;
81
82 m_processing = true;
83
84 while(Count() > 0)
85 {
87 if (!ctx.IsValid())
88 {
89 Remove(0);
90 }
91 else
92 {
93 Remove(0);
94 ctx.Call();
95 }
96 }
97
98 m_processing = false;
99 }
void Remove(Object object)
Definition ActionTargets.c:207

Перекрестные ссылки CallQueueContext::Call(), Count, Get(), CallQueueContext::IsValid() и Remove().

Поля

◆ m_processing

bool m_processing
private

Объявления и описания членов класса находятся в файле: