DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
PluginObjectsInteractionManager.c
См. документацию.
1class PluginObjectsInteractionManager extends PluginBase
2{
5 private const float TIME_TO_FORCED_UNLOCK = 60;
6 private const float TICK_RATE = 10;
7 private ref Timer m_DecayTimer;
8
10 {
13 //TIMERDEPRECATED - timer for decaying objects
14 m_DecayTimer = new Timer();
15 m_DecayTimer.Run(TICK_RATE, this, "Decay", NULL,true);
16 }
17
18 bool IsFree(Object target)
19 {
20 if ( target && m_LockedObjects.Count() > 0 )
21 {
22 for ( int i = 0; i < m_LockedObjects.Count(); i++ )
23 {
24 if ( m_LockedObjects.Get(i) == target )
25 {
26 return false;
27 }
28 }
29 }
30 return true;
31 }
32
33 void Lock(Object target)
34 {
35 if ( target && !IsFree(target) )
36 {
37 m_LockedObjects.Insert(target);
38 m_LockedObjectsDecay.Insert(0);
39 }
40 }
41
42 void Release(Object target)
43 {
44 if ( target && m_LockedObjects.Count() > 0 )
45 {
46 for ( int i = 0; i < m_LockedObjects.Count(); i++ )
47 {
48 if ( m_LockedObjects.Get(i) == target )
49 {
50 m_LockedObjects.Remove(i);
51 m_LockedObjectsDecay.Remove(i);
52 break;
53 }
54 }
55 }
56 }
57
58 //FAILSAFE - checks periodically locked objects and releases them automaticaly if given time has passed
59 void Decay()
60 {
61 if ( m_LockedObjectsDecay.Count() > 0 )
62 {
63 for ( int i = 0; i < m_LockedObjectsDecay.Count(); i++ )
64 {
66 {
67 m_LockedObjects.Remove(i);
68 m_LockedObjectsDecay.Remove(i);
69 }
70 else
71 {
73 }
74 }
75 }
76 }
77};
Определения ObjectTyped.c:2
void Release(Object target)
bool IsFree(Object target)
ref array< float > m_LockedObjectsDecay
ref array< Object > m_LockedObjects
const float TIME_TO_FORCED_UNLOCK
ref Timer m_DecayTimer
const float TICK_RATE
void Lock(Object target)
void PluginObjectsInteractionManager()
Определения PluginBase.c:2
Определения DayZPlayerImplement.c:63
Result for an object found in CGame.IsBoxCollidingGeometryProxy.