Files
CHOMPStation2/code/modules/scripting/stack.dm
CHOMPStation2StaffMirrorBot 65f21fb1d3 [MIRROR] end of file Fix (#10355)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
2025-03-11 17:58:14 +01:00

22 lines
427 B
Plaintext

/stack
var/list/contents=new
/stack/proc/Push(value)
contents+=value
/stack/proc/Pop()
if(!contents.len) return null
. = contents[contents.len]
contents.len--
/stack/proc/Top() //returns the item on the top of the stack without removing it
if(!contents.len) return null
return contents[contents.len]
/stack/proc/Copy()
var/stack/S=new()
S.contents=src.contents.Copy()
return S
/stack/proc/Clear()
contents.Cut()