yapf/yapf_base.hpp
branch0.5
changeset 5494 374bd2a631c7
parent 5445 5af942067209
equal deleted inserted replaced
5493:b7b7d294fe51 5494:374bd2a631c7
   115 		Yapf().PfSetStartupNodes();
   115 		Yapf().PfSetStartupNodes();
   116 
   116 
   117 		while (true) {
   117 		while (true) {
   118 			m_num_steps++;
   118 			m_num_steps++;
   119 			Node *n = m_nodes.GetBestOpenNode();
   119 			Node *n = m_nodes.GetBestOpenNode();
   120 			if (n == NULL) break;
   120 			if (n == NULL)
       
   121 				break;
   121 
   122 
   122 			// if the best open node was worse than the best path found, we can finish
   123 			// if the best open node was worse than the best path found, we can finish
   123 			if (m_pBestDestNode != NULL && m_pBestDestNode->GetCost() < n->GetCostEstimate())
   124 			if (m_pBestDestNode != NULL && m_pBestDestNode->GetCost() < n->GetCostEstimate())
   124 				break;
   125 				break;
   125 
   126 
   157 	}
   158 	}
   158 
   159 
   159 	/** If path was found return the best node that has reached the destination. Otherwise
   160 	/** If path was found return the best node that has reached the destination. Otherwise
   160 	 *  return the best visited node (which was nearest to the destination).
   161 	 *  return the best visited node (which was nearest to the destination).
   161 	 */
   162 	 */
   162 	FORCEINLINE Node& GetBestNode()
   163 	FORCEINLINE Node* GetBestNode()
   163 	{
   164 	{
   164 		return (m_pBestDestNode != NULL) ? *m_pBestDestNode : *m_pBestIntermediateNode;
   165 		return (m_pBestDestNode != NULL) ? m_pBestDestNode : m_pBestIntermediateNode;
   165 	}
   166 	}
   166 
   167 
   167 	/** Calls NodeList::CreateNewNode() - allocates new node that can be filled and used
   168 	/** Calls NodeList::CreateNewNode() - allocates new node that can be filled and used
   168 	 *  as argument for AddStartupNode() or AddNewNode()
   169 	 *  as argument for AddStartupNode() or AddNewNode()
   169 	 */
   170 	 */