protected HashSet <ExploreCell> GetUnexploredCells(ExploreCell origin_cell) { using (new ReadLock(DataLock)) { UnexploredSelector selector = new UnexploredSelector(); Algorihms.Visit <ExploreCell>(origin_cell, MovementFlag.None, -1, null, selector); m_CellsToExploreCount = selector.all_cells_count; m_ExploredCellsCount = m_CellsToExploreCount - selector.unexplored_cells.Count; // first try all big cells unvisited by anyone (undelayed) HashSet <ExploreCell> unexplored_cells_subset = new HashSet <ExploreCell>(selector.unexplored_cells.Where(x => !x.Small && !x.Delayed)); if (unexplored_cells_subset.Count > 0) { return(unexplored_cells_subset); } // try all big cells unvisited by me unexplored_cells_subset = new HashSet <ExploreCell>(selector.unexplored_cells.Where(x => !x.Small)); if (unexplored_cells_subset.Count > 0) { return(unexplored_cells_subset); } // try all remaining cells return(selector.unexplored_cells); } }
protected HashSet <ExploreCell> GetUnexploredCells(ExploreCell origin_cell) { using (new ReadLock(DataLock)) { var agent_pos = m_Navigator.CurrentPos; // unexplored selector is collecting ALL unexplored cells matching constraints and filter criteria UnexploredSelector selector = new UnexploredSelector(ExploreConstraints, ExploreFilter, IgnoreSmall, agent_pos, m_Navmesh); Algorihms.Visit <ExploreCell>(origin_cell, MovementFlag.None, -1, null, selector); m_CellsToExploreCount = selector.all_cells_count; m_ExploredCellsCount = m_CellsToExploreCount - selector.unexplored_cells.Count; // first try all big cells unvisited by anyone (undelayed) HashSet <ExploreCell> unexplored_cells_subset = new HashSet <ExploreCell>(selector.unexplored_cells.Where(x => !x.Small && !x.Delayed)); if (unexplored_cells_subset.Count > 0) { return(unexplored_cells_subset); } // try all big cells unvisited by me unexplored_cells_subset = new HashSet <ExploreCell>(selector.unexplored_cells.Where(x => !x.Small)); if (unexplored_cells_subset.Count > 0) { return(unexplored_cells_subset); } // try all remaining cells return(selector.unexplored_cells); } }