void FloodFrom(Region tregion, Location start, Location c, Material mat, double maxRad) { if ((c - start).LengthSquared() > maxRad * maxRad) { return; } if (tregion.GetBlockMaterial(c) != Material.AIR) { return; } tregion.SetBlockMaterial(c, mat); foreach (Location dir in FloodDirs) { FloodFrom(tregion, start, c + dir, mat, maxRad); } }