Data Queue
scripts/vscripts/alyxlib/data/queue.lua
Methods
Enqueue
Add values to the queue in the order they appear.
Parameters
...
Dequeue
Get a number of values in reverse order of the queue.
Parameters
count(optional)
number
Default is 1
Returns
- ...
Front
Peek at a number of items at the front of the queue without removing them.
Parameters
count(optional)
number
Default is 1
Returns
- ...
Back
Peek at a number of items at the back of the queue without removing them.
Parameters
count(optional)
number
Default is 1
Returns
- ...
Remove
Remove a value from the queue regardless of its position.
Parameters
value
any
MoveToBack
Move an existing value to the front of the queue. Only the first occurance will be moved.
Parameters
value
any
The value to move.
Returns
- boolean
True if value was found and moved.
MoveToFront
Move an existing value to the bottom of the stack. Only the first occurance will be moved.
Parameters
value
any
The value to move.
Returns
- boolean
True if value was found and moved.
Contains
Get if this queue contains a value.
Parameters
value
any
Returns
- boolean
Length
Return the number of items in the queue.
Returns
- integer
IsEmpty
Get if the stack is empty.
pairs
Helper method for looping.
Returns
-
function -
any[] -
number
i
Functions
Queue
Create a new Queue object.
Last value is at the front of the queue.
E.g.
Parameters
...
Returns
- Queue