|
SleakEngine 1.0.0
C++23 multi-backend game engine
|
A list where elements are stored with associated priorities. More...
#include <PriorityList.hpp>
Public Member Functions | |
| T | getHighestPriorityElement () const |
| Returns the element with the highest priority. | |
| void | insert (const T &element, int priority) |
| Inserts an element with the given priority. | |
| void | removeHighestPriorityElement () |
| Removes the element with the highest priority. | |
A list where elements are stored with associated priorities.
This class provides a way to store elements with priorities and efficiently retrieve or remove the element with the highest priority. It is suitable for scenarios where you need to manage a collection of items with different priorities, such as task scheduling, event handling, or AI decision-making.
Example Use Cases:
Implementation Details:
Definition at line 32 of file PriorityList.hpp.
|
inline |
Returns the element with the highest priority.
| std::runtime_error | if the list is empty. |
Definition at line 55 of file PriorityList.hpp.
|
inline |
Inserts an element with the given priority.
| element | The element to insert. |
| priority | The priority of the element. |
Definition at line 40 of file PriorityList.hpp.
|
inline |
Removes the element with the highest priority.
| std::runtime_error | if the list is empty. |
Definition at line 67 of file PriorityList.hpp.