Exemple #1
0
        private AStarData GetData(IGraphNode node)
        {
            if (_dataDict.TryGetValue(node, out var data))
            {
                return(data);
            }

            data = new AStarData();
            _dataDict.Add(node, data);

            return(data);
        }
 /// <summary>
 /// Adds a INode to the SortedList.
 /// </summary>
 /// <param name="sortedList">SortedList to add the node to.</param>
 /// <param name="node">Node to add to the sortedList.</param>
 /// <param name="data"> Данные узла для алгоритма. </param>
 internal static void AddWithData(this SortedList <int, IGraphNode> sortedList, IGraphNode node, AStarData data)
 {
     sortedList.Add(data.TotalCost, node);
 }