Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
simplecircularbuffer.c
Go to the documentation of this file.
1class SimpleCircularBuffer<Class T>
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 = 0)
13 {
14 m_Size = pSize;
15
16 for (int i = 0; i < m_Size; i++)
17 {
18 m_Samples.Insert(pDefaultValue);
19 }
20 }
21
31 void Add(T newSample)
32 {
33 m_Samples[m_Pointer++] = newSample;
34 if (m_Pointer == m_Size)
35 {
36 m_Pointer = 0;
37 }
38 }
39
44 T Get(T pIndex)
45 {
46 return m_Samples[pIndex];
47 }
48
53 array<T> GetValues()
54 {
55 return m_Samples;
56 }
57}
Super root of all classes in Enforce script.
Definition enscript.c:11
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
override float Get()
void Add(string name, string value)