src/yapf/yapf_base.hpp
branchcpp_gui
changeset 6308 646711c5feaa
parent 6268 4b5241e5dd10
equal deleted inserted replaced
6307:f40e88cff863 6308:646711c5feaa
   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 
   158 	}
   159 	}
   159 
   160 
   160 	/** If path was found return the best node that has reached the destination. Otherwise
   161 	/** If path was found return the best node that has reached the destination. Otherwise
   161 	 *  return the best visited node (which was nearest to the destination).
   162 	 *  return the best visited node (which was nearest to the destination).
   162 	 */
   163 	 */
   163 	FORCEINLINE Node& GetBestNode()
   164 	FORCEINLINE Node* GetBestNode()
   164 	{
   165 	{
   165 		return (m_pBestDestNode != NULL) ? *m_pBestDestNode : *m_pBestIntermediateNode;
   166 		return (m_pBestDestNode != NULL) ? m_pBestDestNode : m_pBestIntermediateNode;
   166 	}
   167 	}
   167 
   168 
   168 	/** Calls NodeList::CreateNewNode() - allocates new node that can be filled and used
   169 	/** Calls NodeList::CreateNewNode() - allocates new node that can be filled and used
   169 	 *  as argument for AddStartupNode() or AddNewNode()
   170 	 *  as argument for AddStartupNode() or AddNewNode()
   170 	 */
   171 	 */