Space Station 13 - Modules - TypesVar Details - Proc Details

stack

Vars

max_elementsInteger. Maximum number of elements the stack can contain. If 0, has no limit. Defined during New().
stackList. Items within the stack. Initially defined during New().

Procs

ClearClears the stack of all entries.
CopyReturns a copy of the stack as a new instance of /datum/stack.
PopReturns then removes the rightmost/last element in the stack.
PushAdds element to the stack, unless the stack is already at the limit defined by max_elements.
QdelClearqdel()s every entry in the stack, then clears the stack.
RemoveRemoves element from the stack, if present.
RotateLeftRotates the entire stack left/backward with the leftmost/first element looping around to the right/end.
RotateRightRotates the entire stack right/forward with the rightmost/last element looping around to the left/beginning.
TopReturns the rightmost/last element in the stack.
is_emptyChecks if the stack is currently empty. Returns boolean.

Var Details

max_elements

Integer. Maximum number of elements the stack can contain. If 0, has no limit. Defined during New().

stack

List. Items within the stack. Initially defined during New().

Not intended to reference directly. Instead, see the various procs under /datum/stack.

Proc Details

Clear

Clears the stack of all entries.

Copy

Returns a copy of the stack as a new instance of /datum/stack.

Pop

Returns then removes the rightmost/last element in the stack.

Push

Adds element to the stack, unless the stack is already at the limit defined by max_elements.

QdelClear

qdel()s every entry in the stack, then clears the stack.

Remove

Removes element from the stack, if present.

RotateLeft

Rotates the entire stack left/backward with the leftmost/first element looping around to the right/end.

Returns FALSE is the stack is empty.

RotateRight

Rotates the entire stack right/forward with the rightmost/last element looping around to the left/beginning.

Returns FALSE is the stack is empty.

Top

Returns the rightmost/last element in the stack.

is_empty

Checks if the stack is currently empty. Returns boolean.