1 | #region License |
---|
2 | /* |
---|
3 | The MIT License (MIT) |
---|
4 | |
---|
5 | Copyright (c) 2013 Daniel "BlueRaja" Pflughoeft |
---|
6 | |
---|
7 | Permission is hereby granted, free of charge, to any person obtaining a copy |
---|
8 | of this software and associated documentation files (the "Software"), to deal |
---|
9 | in the Software without restriction, including without limitation the rights |
---|
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
---|
11 | copies of the Software, and to permit persons to whom the Software is |
---|
12 | furnished to do so, subject to the following conditions: |
---|
13 | |
---|
14 | The above copyright notice and this permission notice shall be included in |
---|
15 | all copies or substantial portions of the Software. |
---|
16 | |
---|
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
---|
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
---|
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
---|
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
---|
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
---|
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
---|
23 | THE SOFTWARE. |
---|
24 | */ |
---|
25 | #endregion |
---|
26 | |
---|
27 | namespace SimSharp { |
---|
28 | |
---|
29 | /// <summary> |
---|
30 | /// A node class for the generic priority queue |
---|
31 | /// </summary> |
---|
32 | public class GenericPriorityQueueNode { |
---|
33 | /// <summary> |
---|
34 | /// Represents the current position in the queue |
---|
35 | /// </summary> |
---|
36 | public int QueueIndex { get; internal set; } |
---|
37 | |
---|
38 | /// <summary> |
---|
39 | /// Represents the order the node was inserted in |
---|
40 | /// </summary> |
---|
41 | public long InsertionIndex { get; internal set; } |
---|
42 | } |
---|
43 | |
---|
44 | /// <summary> |
---|
45 | /// A node class for the generic priority queue with an explicit priority type |
---|
46 | /// </summary> |
---|
47 | /// <remarks> |
---|
48 | /// Original sources from https://github.com/BlueRaja/High-Speed-Priority-Queue-for-C-Sharp |
---|
49 | /// </remarks> |
---|
50 | /// <typeparam name="TPriority"></typeparam> |
---|
51 | public class GenericPriorityQueueNode<TPriority> : GenericPriorityQueueNode { |
---|
52 | /// <summary> |
---|
53 | /// 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). |
---|
54 | /// Should not be manually edited once the node has been enqueued - use queue.UpdatePriority() instead |
---|
55 | /// </summary> |
---|
56 | public TPriority Priority { get; protected internal set; } |
---|
57 | } |
---|
58 | } |
---|