ds_priority_delete_min

Returns the value in the priority queue with the smallest priority, and deletes it.

Syntax:

GML Code Example

ds_priority_delete_min(id);


Argument Description
id The id of the priority queue to use.


Returns: Real or String


Description

This function will return the value that has the lowest priority in the queue and then remove the value (and priority) from the data structure. If more than one value has the same priority, the one that was added to the priority queue first will be the one to get removed, but all other values with the same priority will still be in the queue.


Example:

GML Code Example

if ai_move
    {
    script_execute(ds_priority_delete_min(ai_priority));
    }
 

The above code checks an instance variable and if it returns true it will execute a script indexed in the priority queue with the lowest priority value and then remove that script from the queue.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here