private void TryQueueNewTile(IPathNode pNewNode, PathLink pLink, AStarStack pNodesToVisit, IPathNode pGoal) { IPathNode previousNode = pLink.GetOtherNode(pNewNode); float linkDistance = pLink.distance; float newPathCost = previousNode.pathCostHere + pNewNode.baseCost + linkDistance; if (pNewNode.linkLeadingHere == null || (pNewNode.pathCostHere > newPathCost)) { pNewNode.distanceToGoal = pNewNode.DistanceTo(pGoal) * 2f; pNewNode.pathCostHere = newPathCost; pNewNode.linkLeadingHere = pLink; pNodesToVisit.Push(pNewNode); } }
public void RemoveLink(PathLink pLink) { links.Remove(pLink); }
public void AddLink(PathLink pLink) { links.Add(pLink); }