/// <summary> /// Gets a collection of chunk coordinates whose Chebyshev distance to <paramref name="coordinate"/> is more than <paramref name="range"/> /// </summary> /// <param name="coordinate">Central coordinate</param> /// <param name="range">The maximum allowed Chebyshev distance</param> /// <returns>A collection of chunk coordinates outside of <paramref name="range"/> from <paramref name="coordinate"/></returns> public virtual IEnumerable <int3> GetChunkCoordinatesOutsideOfRange(int3 coordinate, int range) { foreach (int3 chunkCoordinate in _chunks.Keys.ToList()) { if (DistanceUtilities.ChebyshevDistanceGreaterThan(coordinate, chunkCoordinate, range)) { yield return(chunkCoordinate); } } }
/// <summary> /// Gets all the coordinates of the chunks that already exist or are currently being generated, where the Chebyshev distance from <paramref name="coordinate"/> to the chunk's coordinate is more than <paramref name="range"/> /// </summary> /// <param name="coordinate">The central coordinate where the distances should be measured from</param> /// <param name="range">The maximum allowed manhattan distance</param> /// <returns></returns> public override IEnumerable <int3> GetChunkCoordinatesOutsideOfRange(int3 coordinate, int range) { foreach (var baseCoordinate in base.GetChunkCoordinatesOutsideOfRange(coordinate, range)) { yield return(baseCoordinate); } int3[] generationJobHandleArray = _generationJobHandles.Keys.ToArray(); for (int i = 0; i < generationJobHandleArray.Length; i++) { int3 generationCoordinate = generationJobHandleArray[i]; if (DistanceUtilities.ChebyshevDistanceGreaterThan(coordinate, generationCoordinate, range)) { yield return(generationCoordinate); } } }