예제 #1
0
파일: AStar.cs 프로젝트: tgspn/Zilon
        private AStarData GetData(IMapNode node)
        {
            if (!_dataDict.TryGetValue(node, out var data))
            {
                data = new AStarData();
                _dataDict.Add(node, data);
            }

            return(data);
        }
예제 #2
0
 /// <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 Add(this SortedList <int, IMapNode> sortedList, IMapNode node, AStarData data)
 {
     sortedList.Add(data.TotalCost, node);
 }