/// <summary> /// 搜寻下一次,return finished /// </summary> /// <returns></returns> private bool FindNext() { // 已经有结果 if (m_Result.Count > 0) { return(true); } // 选择节点 m_CurrentCell = m_HowToFind.ChoseCell(this); // 判断是否搜索结束 if (m_HowToFind.IsFinishedOnChose(this)) { // 如果结束,建立结果 m_HowToFind.BuildResult(this); return(true); } // 当前选择的节点不为null if (m_CurrentCell != null) { for (int i = 0; i < m_CurrentCell.adjacents.Count; i++) { // 是否可以加入到开放集中 if (m_HowToFind.CanAddAdjacentToReachable(this, m_CurrentCell.adjacents[i])) { m_Reachable.Add(m_CurrentCell.adjacents[i]); } } } return(false); }
/// <summary> /// 搜寻下一次, return finished /// </summary> /// <returns><c>true</c>, if next was found, <c>false</c> otherwise.</returns> private bool FindNext() { if (result.Count > 0) { return(true); } // 选择节点 currentCell = howToFind.ChoseCell(this); // 判断是否搜索结束 if (howToFind.IsFinishedOnChose(this)) { // 如果结束, 建立结果 howToFind.BuildResult(this); return(true); } // 当前选择的节点不为 null if (currentCell != null) { for (int i = 0; i < currentCell.Adjacents.Count; i++) { // 是否可以加入到开放集中 if (howToFind.CanAddAdjacentToReachable(this, currentCell.Adjacents[i])) { reachable.Add(currentCell.Adjacents[i]); } } } return(false); }