GenericPriorityQueueNode.cs 962 B

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