AStar_Incomplete.AStarPathFinder.OpenUpdatePathCost C# (CSharp) Метод

OpenUpdatePathCost() приватный Метод

private OpenUpdatePathCost ( AStar_Incomplete.Node parentNode, int gCost, int cellIndex ) : bool
parentNode AStar_Incomplete.Node
gCost int
cellIndex int
Результат bool
        private bool OpenUpdatePathCost(Node parentNode, int gCost, int cellIndex)
        {
            var adjacentNode = _openList.SingleOrDefault(n => n.CellIndex == cellIndex);
            if (adjacentNode != null)
            {
                if (parentNode.G + gCost < adjacentNode.G)
                {
                    adjacentNode.Parent = parentNode;
                    /*
                    * TODO: calculate the values of G and H for adjacentNode
                    */

                }
                return true;
            }
            return false;
        }