Example #1
0
        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);
        }
Example #2
0
        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());
        }
Example #3
0
        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);
        }
Example #4
0
 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)))));
 }