Skip to content

ams.xlua.Stack

Captain Spaulding edited this page Nov 17, 2021 · 1 revision

DESCRIPTION

Implements a LIFO stack class, providing the handling methods.

USAGE

local Stack = require('ams.xlua.Stack')

Defines a local Stack constructor.

PROVIDES

  • Stack(size) - Creates a new stack object of given size and returns it

STACK CLASS

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

RETURNS

Nothing.

DEPENDANCIES

None.

ams.core

ams.sys

  • ams.sys.info
  • ams.sys.timer
  • ams.sys.win.timer

ams.SDK

  • 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.carillon

  • ams.carillon.carillon

ams.utils

  • ams.utils.tts

ams.install

  • ams.install.loader

ams.ext

kickstarter

AMS Scripts

Clone this wiki locally