コード例 #1
0
        public IPathNode Pop()
        {
            IPathNode result = null;

            foreach (IPathNode p in _nodes.Values)
            {
                if (result == null || p.CompareTo(result) == 1)
                {
                    result = p;                        //p has a shorter distance than result
                }
            }

            if (result == null)
            {
                return(null);
            }
            else
            {
                _nodes.Remove(result.GetUniqueID());
                return(result);
            }
        }
コード例 #2
0
ファイル: AStarStack.cs プロジェクト: substans/Pathfinding
 public void Push(IPathNode pNode)
 {
     _nodes[pNode.GetUniqueID()] = pNode;
 }
コード例 #3
0
 public void Push(IPathNode pNode)
 {
     _nodes[pNode.GetUniqueID()] = pNode;
 }