DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
SimpleCircularBuffer.c
См. документацию.
2{
3 private int m_Pointer = 0;
4 private int m_Size = 0;
5 private ref array<T> m_Samples = new array<T>();
6
12 void SimpleCircularBuffer(int pSize, T pDefaultValue)
13 {
14 m_Size = pSize;
15
16 for (int i = 0; i < m_Size; ++i)
17 m_Samples.Insert(pDefaultValue);
18 }
19
29 void Add(T newSample)
30 {
31 m_Samples[m_Pointer++] = newSample;
32 if (m_Pointer == m_Size)
33 m_Pointer = 0;
34 }
35
40 T Get(int pIndex)
41 {
42 return m_Samples[pIndex];
43 }
44
50 {
51 return m_Samples;
52 }
53}
Super root of all classes in Enforce script.
Определения EnScript.c:11
T Get(int pIndex)
Returns value from given index.
Определения SimpleCircularBuffer.c:40
void Add(T newSample)
Add new value to buffer.
Определения SimpleCircularBuffer.c:29
array< T > GetValues()
Returns array of values stored in buffer.
Определения SimpleCircularBuffer.c:49
ref array< T > m_Samples
Определения SimpleCircularBuffer.c:5
void SimpleCircularBuffer(int pSize, T pDefaultValue)
Initialize Simple Circular Buffer Cyclic Buffer.
Определения SimpleCircularBuffer.c:12
Result for an object found in CGame.IsBoxCollidingGeometryProxy.