GenericPriorityQueueNode.cs 861 B

12345678910111213141516171819202122
  1. namespace Priority_Queue
  2. {
  3. /// Credit: https://github.com/BlueRaja/High-Speed-Priority-Queue-for-C-Sharp
  4. public class GenericPriorityQueueNode<TPriority>
  5. {
  6. /// <summary>
  7. /// The Priority to insert this node at. Must be set BEFORE adding a node to the queue (ideally just once, in the node's constructor).
  8. /// Should not be manually edited once the node has been enqueued - use queue.UpdatePriority() instead
  9. /// </summary>
  10. public TPriority Priority { get; protected internal set; }
  11. /// <summary>
  12. /// Represents the current position in the queue
  13. /// </summary>
  14. public int QueueIndex { get; internal set; }
  15. /// <summary>
  16. /// Represents the order the node was inserted in
  17. /// </summary>
  18. public long InsertionIndex { get; internal set; }
  19. }
  20. }