-
Notifications
You must be signed in to change notification settings - Fork 1
/
DataSet.cs
34 lines (29 loc) · 883 Bytes
/
DataSet.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using Priority_Queue;
using System;
using System.Text;
public class DataSet<T> where T : class, IAstarNode<T>
{
public T current;
public int prevId;
public int distTraveled;
public DataNode<T> node { get; protected set; }
public DataSet(T current, int prevId, int distTraveled, int estCost)
{
this.current = current;
node = new DataNode<T>(current.AStarIndex, estCost);
Repopulate(prevId, distTraveled);
}
public void Repopulate(int prevId, int distTraveled)
{
this.prevId = prevId;
this.distTraveled = distTraveled;
}
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("Current: " + current );
sb.AppendLine("prev: " + prevId );
sb.AppendLine("DistTraveled: " + distTraveled);
return sb.ToString();
}
}