|
OpenTTD GameScript API
13.1
|
Class that creates a queue which keeps its items ordered by an item priority. More...
Public Member Functions | |
| bool | Insert (void *item, int64 priority) |
| Add a single item to the queue. More... | |
| void * | Pop () |
| Remove and return the item with the lowest priority. More... | |
| void * | Peek () |
| Get the item with the lowest priority, keeping it in the queue. More... | |
| bool | Exists (void *item) |
| Check if an items is already included in the queue. More... | |
| void | Clear () |
| Clear the queue, making Count() returning 0 and IsEmpty() returning true. | |
| bool | IsEmpty () |
| Check if the queue is empty. More... | |
| SQInteger | Count () |
| Returns the amount of items in the queue. More... | |
Class that creates a queue which keeps its items ordered by an item priority.
| SQInteger GSPriorityQueue::Count | ( | ) |
Returns the amount of items in the queue.
| bool GSPriorityQueue::Exists | ( | void * | item | ) |
Check if an items is already included in the queue.
| item | The item to check whether it's already in this queue. |
| bool GSPriorityQueue::Insert | ( | void * | item, |
| int64 | priority | ||
| ) |
Add a single item to the queue.
| item | The item to add. Can be any Squirrel type. Should be unique, otherwise it is ignored. |
| priority | The priority to assign the item. |
| bool GSPriorityQueue::IsEmpty | ( | ) |
Check if the queue is empty.
| void* GSPriorityQueue::Peek | ( | ) |
Get the item with the lowest priority, keeping it in the queue.
| void* GSPriorityQueue::Pop | ( | ) |
Remove and return the item with the lowest priority.
1.8.17