Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_Stack.c
Go to the documentation of this file.
1
4
// may be replaced with cpp implementation with script API later on
5
class
SCR_Stack<
Class
T
>
6
{
7
protected
ref array<ref T>
m_aArray
= {};
8
9
//------------------------------------------------------------------------------------------------
12
void
Push
(
T
item)
13
{
14
m_aArray
.Insert(item);
15
}
16
17
//------------------------------------------------------------------------------------------------
20
T
Pop
()
21
{
22
int
index
=
m_aArray
.Count() - 1;
23
if
(
index
< 0)
24
return
null;
25
26
T
poppedItem =
m_aArray
[
index
];
27
m_aArray
.Remove(
index
);
28
29
return
poppedItem;
30
}
31
32
//------------------------------------------------------------------------------------------------
35
T
Top
()
36
{
37
int
index
=
m_aArray
.Count() - 1;
38
if
(
index
< 0)
39
return
null;
40
41
return
m_aArray
[
index
];
42
}
43
44
//------------------------------------------------------------------------------------------------
47
T
Bottom
()
48
{
49
if
(
m_aArray
.IsEmpty())
50
return
null;
51
52
return
m_aArray
[0];
53
}
54
55
//------------------------------------------------------------------------------------------------
57
bool
IsEmpty
()
58
{
59
return
m_aArray
.IsEmpty();
60
}
61
62
//------------------------------------------------------------------------------------------------
64
int
Count
()
65
{
66
return
m_aArray
.Count();
67
}
68
}
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition
SCR_DestructionSynchronizationComponent.c:17
T
class SCR_MapHelperT< Class T, Class U > T
Class
Super root of all classes in Enforce script.
Definition
Types.c:35
SCR_Stack< Class T >::m_aArray
ref array< ref T > m_aArray
Definition
SCR_Stack.c:7
SCR_Stack< Class T >::IsEmpty
bool IsEmpty()
Definition
SCR_Stack.c:57
SCR_Stack< Class T >::Push
void Push(T item)
Definition
SCR_Stack.c:12
SCR_Stack< Class T >::Pop
T Pop()
Definition
SCR_Stack.c:20
SCR_Stack< Class T >::Top
T Top()
Definition
SCR_Stack.c:35
SCR_Stack< Class T >::Count
int Count()
Returns the count of elements stored in this stack.
Definition
SCR_Stack.c:64
SCR_Stack< Class T >::Bottom
T Bottom()
Definition
SCR_Stack.c:47
scripts
Game
Utilities
SCR_Stack.c
Generated by
1.17.0