30 mask &operator=(
const mask &) =
default;
33 mask &operator=(
mask &&) noexcept = default;
39 bool operator()(
unsigned int row,
unsigned int column) const noexcept;
45 void set(
unsigned int row,
unsigned int column,
bool is_on) noexcept;
59 [[nodiscard]]
unsigned int rows() const noexcept;
63 [[nodiscard]]
unsigned int columns() const noexcept;
86 std::vector<std::vector<
bool>> m_bits;
void set(unsigned int row, unsigned int column, bool is_on) noexcept
Set a cell's availability.
static mask from_string(std::string_view text)
Load a mask from an inline string.
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.
int count() const noexcept
Count the number of available cells.
unsigned int rows() const noexcept
Get the number of rows.
mask(unsigned int rows, unsigned int columns)
Construct a mask with specified dimensions, all cells enabled.
static mask from_source(std::string_view source)
Load a mask from either a file path or an inline string.
Provides random-number generating capabilities.
Definition randomizer.h:16