Arma Reforger Script API
Loading...
Searching...
No Matches
SCR_Stack< Class T > Interface Template Reference

Wrapper for array that works as a stack. More...

Public Member Functions

void Push (T item)
 Push an item to the end of the stack.
 
Pop ()
 Pop an item from the top of the stack.
 
Top ()
 Get the last inserted and topmost element without popping it from the stack.
 
Bottom ()
 Get the first inserted and topmost element without popping it from the stack.
 
bool IsEmpty ()
 
int Count ()
 Returns the count of elements stored in this stack.
 

Protected Attributes

ref array< ref T > m_aArray = {}
 

Detailed Description

Wrapper for array that works as a stack.

  • items are stored as 'first in, last out'
  • items inside are always ref, so bear that in mind

Member Function Documentation

◆ Bottom()

T SCR_Stack< Class T >.Bottom ( )

Get the first inserted and topmost element without popping it from the stack.

Returns
the last inserted and topmost element, null if no element is present

◆ Count()

int SCR_Stack< Class T >.Count ( )

Returns the count of elements stored in this stack.

◆ IsEmpty()

bool SCR_Stack< Class T >.IsEmpty ( )
Returns
true if stack is empty, false otherwise

◆ Pop()

T SCR_Stack< Class T >.Pop ( )

Pop an item from the top of the stack.

Returns
the last inserted and topmost element, null if no element is present

◆ Push()

void SCR_Stack< Class T >.Push ( T item)

Push an item to the end of the stack.

Parameters
[in]itemthe item to push

◆ Top()

T SCR_Stack< Class T >.Top ( )

Get the last inserted and topmost element without popping it from the stack.

Returns
the last inserted and topmost element, null if no element is present

Member Data Documentation

◆ m_aArray

ref array<ref T> SCR_Stack< Class T >.m_aArray = {}
protected

The documentation for this interface was generated from the following file: