29 mask& operator=(
const mask&) =
default;
32 mask& operator=(
mask&&) noexcept = default;
38 bool operator()(
unsigned int row,
unsigned int column) const noexcept;
44 void set(
unsigned int row,
unsigned int column,
bool is_on) noexcept;
58 [[nodiscard]]
unsigned int rows() const noexcept {
return m_rows; }
62 [[nodiscard]]
unsigned int columns() const noexcept {
return m_columns; }
73 unsigned int m_columns;
74 std::vector<std::vector<bool>> m_bits;
2D boolean mask for controlling which cells are available in maze generation
Definition mask.h:19
void set(unsigned int row, unsigned int column, bool is_on) noexcept
Set a cell's availability.
static mask from_txt(const std::string &filename)
Load a mask from a text file.
std::pair< unsigned int, unsigned int > random_location(randomizer &rng) const noexcept
Get a random available cell location.
unsigned int columns() const noexcept
Get the number of columns.
Definition mask.h:62
int count() const noexcept
Count the number of available cells.
unsigned int rows() const noexcept
Get the number of rows.
Definition mask.h:58
mask(unsigned int rows, unsigned int columns)
Construct a mask with specified dimensions, all cells enabled.
Provides random-number generating capabilities.
Definition randomizer.h:15