IEnumerable <Element> GetNearestElements(Coordinate coordinate, int size) { TryInitDic(); for (int x = coordinate.X - size; x <= coordinate.X + size; x++) { for (int z = coordinate.Z - size; z <= coordinate.Z + size; z++) { Cell cell; if (_cellsDic.TryGetValue(Coordinate.CalcHashCode(x, z), out cell)) { foreach (var element in cell.Elements) { yield return(element); } } } } }