我們還需要一個結構來保存在路徑規劃過程中的中間結果:
Code
[copy to clipboard]CODE:
/// <summary>
/// RoutePlanData 用於封裝一次路徑規劃過程中 的規劃信息。
/// </summary>
public class RoutePlanData
{
#region CellMap
private Rectangle cellMap;
/// <summary>
/// CellMap 地圖的矩形大小。經過單元格標准處理。
/// </summary>
public Rectangle CellMap
{
get { return cellMap; }
}
#endregion
#region ClosedList
private IList<AStarNode> closedList = new List<AStarNode>();
/// <summary>
/// ClosedList 關閉列表,即存 放已經遍歷處理過的節點。
/// </summary>
public IList<AStarNode> ClosedList
{
get { return closedList; }
}
#endregion
#region OpenedList
private IList<AStarNode> openedList = new List<AStarNode>();
/// <summary>
/// OpenedList 開放列表,即存 放已經開發但是還未處理的節點。
/// </summary>
public IList<AStarNode> OpenedList
{
get { return openedList; }
}
#endregion
#region Destination
private Point destination;
/// <summary>
/// Destination 目的節點的位置。
/// </summary>
public Point Destination
{
get { return destination; }
}
#endregion
#region Ctor
public RoutePlanData(Rectangle map, Point _destination)
{
this.cellMap = map;
this.destination = _destination;
}
#endregion
}