public IEnumerable <Cell> GetCellsAt(Vec3 pos, bool test_2d, float z_tolerance, bool include_replacement = true) { var cells = Cells.Where(x => (test_2d ? x.Contains2D(pos) : x.Contains(pos, z_tolerance))); if (include_replacement) { return(cells.Concat(ReplacementCells.Where(x => (test_2d ? x.Contains2D(pos) : x.Contains(pos, z_tolerance))))); } return(cells); }
public List <Cell> GetCells(Func <Cell, bool> predicate, bool allow_replacement_cells = true) { var result = Cells.Where(predicate); if (allow_replacement_cells) { result = result.Concat(ReplacementCells.Where(predicate)); } return(result.ToList()); }
public List <Cell> GetCells(Func <Cell, bool> predicate, bool include_replacement = true) { var result = Cells.Where(predicate).ToList(); if (include_replacement) { result.AddRange(ReplacementCells.Where(predicate)); } return(result); }
public IEnumerable <Cell> GetCellsAt(Vec3 pos, bool test_2d, float z_tolerance) { return(Cells.Where(x => (test_2d ? x.Contains2D(pos) : x.Contains(pos, z_tolerance))). Concat(ReplacementCells.Where(x => (test_2d ? x.Contains2D(pos) : x.Contains(pos, z_tolerance))))); }