-
Notifications
You must be signed in to change notification settings - Fork 0
ams.xlua.Stack
Captain Spaulding edited this page Nov 17, 2021
·
1 revision
Implements a LIFO stack class, providing the handling methods.
local Stack = require('ams.xlua.Stack')
Defines a local Stack constructor.
-
Stack(size)- Creates a new stack object of given size and returns it
| type | description | |
|---|---|---|
<Stack>() |
method | Sames as <Stack>:pop()
|
<Stack>(el) |
method | Sames as <Stack>:push(el)
|
<Stack>:pop() |
method | Pop an element from the stack |
<Stack>:push(el) |
method | Push an element to the stack |
<Stack>:ipairs([idx]) |
method | Returns a index-value pair at each iteration, starting from the given index |
<Stack>:rev_ipairs([idx]) |
method | Returns a index-value pair in reverse order at each iteration, starting from the given index |
<Stack>:pairs([idx]) |
method | Sames as <Stack>:ipairs([idx])
|
<Stack>:rev_pairs([idx]) |
method | Sames as <Stack>:rev_ipairs([idx])
|
<Stack>:max([num]) |
method | Returns the biggest value in the stack or in the first num elements |
<Stack>:min([num]) |
method | Returns the smallest value in the stack or in the first num elements |
<Stack>:sum([num]) |
method | Returns the sum of all the values in the stack or of the first num elements |
<Stack>:average([num]) |
method | Returns the average of all the values in the stack or of the first num elements |
<Stack>.last |
read_only | Index of the last element of the stack |
<Stack>.size |
variable | Dimension of the stack |
Nothing.
None.
AMS an Advanced Library Package for FlyWithLua
Updated to v.1.55a (private alpha)
Copyright (C) 2021 Pasquale Croce
- ams.core.kernel
-
ams.core.dref_mgr
- ams:create_dref()
- ams:create_command()
- ams:map_dref()
- ams.core.wm
- ams:register_window()
- ams.core.for_loop
- ams:for_loop()
- ams.core.spc
- ams:spc()
-
ams.core.procs_mon
- ams:procs_mon()
- ams.core.debug
- ams.core.config
- ams.sys.info
- ams.sys.timer
- ams.sys.win.timer
- ams.SDK.XPML
- ams.SDK.scenery
- ams.SDK.map
- ams.SDK.datarefs
- ams.SDK.AIplanes
- ams.SDK.menus
- ams.SDK.processing
- ams.SDK.graphics
- ams.xlua.math
- ams.xlua.strings
- ams.xlua.table
- ams.xlua.Vec2D
- ams.xlua.Const
- ams.xlua.Stack
- ams.carillon.carillon
- ams.utils.tts
- ams.install.loader