GenericPriorityQueueNode.cs 981 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Priority_Queue
  7. {
  8. /// Credit: https://github.com/BlueRaja/High-Speed-Priority-Queue-for-C-Sharp
  9. public class GenericPriorityQueueNode<TPriority>
  10. {
  11. /// <summary>
  12. /// 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).
  13. /// Should not be manually edited once the node has been enqueued - use queue.UpdatePriority() instead
  14. /// </summary>
  15. public TPriority Priority { get; protected internal set; }
  16. /// <summary>
  17. /// Represents the current position in the queue
  18. /// </summary>
  19. public int QueueIndex { get; internal set; }
  20. /// <summary>
  21. /// Represents the order the node was inserted in
  22. /// </summary>
  23. public long InsertionIndex { get; internal set; }
  24. }
  25. }