Maze Builder Docs 8.10.23
Loading...
Searching...
No Matches
mazes::configurator Class Referencefinal

Configuration class for arguments. More...

#include <configurator.h>

Public Member Functions

configurator & ensure_rows (const unsigned int rows) noexcept
 Set the number of rows.
configurator & ensure_columns (const unsigned int columns) noexcept
 Set the number of columns.
configurator & ensure_levels (const unsigned int levels) noexcept
 Set the number of levels.
configurator & ensure_algo_id (const algo algorithm) noexcept
 Set the maze generation algorithm.
configurator & ensure_distances (const bool distances) noexcept
 Set the distance calculation flag.
configurator & ensure_distances_start (const int start_index) noexcept
 Set the distance start index.
configurator & ensure_distances_end (const int end_index) noexcept
 Set the distance end index.
configurator & rows (const unsigned int r) noexcept
configurator & columns (const unsigned int c) noexcept
configurator & levels (const unsigned int l) noexcept
configurator & algo_id (const algo a) noexcept
unsigned int rows () const noexcept
 Get the number of rows.
unsigned int columns () const noexcept
 Get the number of columns.
unsigned int levels () const noexcept
 Get the number of levels.
algo algo_id () const noexcept
 Get the maze generation algorithm.
bool distances () const noexcept
 Check if distances are calculated.
int distances_start () const noexcept
 Get the distance start index.
int distances_end () const noexcept
 Get the distance end index.
configurator & ensure_mask_source (const std::string &mask_source) noexcept
 Set the mask source.
configurator & ensure_mask_file (const std::string &mask_file_path) noexcept
 Set the mask file path.
std::string mask_source () const noexcept
 Get the mask source.
std::string mask_file () const noexcept
 Get the mask file path.
bool has_valid_dimensions () const noexcept
 Validate all configuration values are within safe limits.

Static Public Attributes

static constexpr auto MAX_COLUMNS = 100u
static constexpr auto MAX_LEVELS = 100u
static constexpr auto MAX_ROWS = 100u
static constexpr auto DEFAULT_DISTANCES_START = 0
static constexpr auto DEFAULT_DISTANCES_END = -1
static constexpr auto DEFAULT_SEED_VALUE = 1'000'000u

Detailed Description

Configuration class for arguments.

This class stores maze generation parameters with safe default values

Member Function Documentation

◆ algo_id()

algo mazes::configurator::algo_id ( ) const
inlinenodiscardnoexcept

Get the maze generation algorithm.

Returns
The algorithm used for maze generation

◆ columns()

unsigned int mazes::configurator::columns ( ) const
inlinenodiscardnoexcept

Get the number of columns.

Returns
The number of columns (guaranteed to be > 0)

◆ distances()

bool mazes::configurator::distances ( ) const
inlinenodiscardnoexcept

Check if distances are calculated.

Returns
True if distances are calculated, false otherwise

◆ distances_end()

int mazes::configurator::distances_end ( ) const
inlinenodiscardnoexcept

Get the distance end index.

Returns
The ending cell index for distance calculation

◆ distances_start()

int mazes::configurator::distances_start ( ) const
inlinenodiscardnoexcept

Get the distance start index.

Returns
The starting cell index for distance calculation

◆ ensure_algo_id()

configurator & mazes::configurator::ensure_algo_id ( const algo algorithm)
inlinenoexcept

Set the maze generation algorithm.

Parameters
algorithmThe algorithm to use
Returns
A reference to this configurator

◆ ensure_columns()

configurator & mazes::configurator::ensure_columns ( const unsigned int columns)
inlinenoexcept

Set the number of columns.

Parameters
columnsThe number of columns (must be > 0, will be clamped to reasonable limits)
Returns
A reference to this configurator
Warning
Values will be clamped to prevent memory issues

◆ ensure_distances()

configurator & mazes::configurator::ensure_distances ( const bool distances)
inlinenoexcept

Set the distance calculation flag.

Parameters
distancesThe distance calculation flag
Returns
A reference to this configurator

◆ ensure_distances_end()

configurator & mazes::configurator::ensure_distances_end ( const int end_index)
inlinenoexcept

Set the distance end index.

Parameters
end_indexThe ending cell index for distance calculation
Returns
A reference to this configurator

◆ ensure_distances_start()

configurator & mazes::configurator::ensure_distances_start ( const int start_index)
inlinenoexcept

Set the distance start index.

Parameters
start_indexThe starting cell index for distance calculation
Returns
A reference to this configurator

◆ ensure_levels()

configurator & mazes::configurator::ensure_levels ( const unsigned int levels)
inlinenoexcept

Set the number of levels.

Parameters
levelsThe number of levels (must be > 0, will be clamped to reasonable limits)
Returns
A reference to this configurator
Warning
Values will be clamped to prevent memory issues
Note
Most mazes are 2D (levels=1), 3D mazes should use moderate level counts

◆ ensure_mask_file()

configurator & mazes::configurator::ensure_mask_file ( const std::string & mask_file_path)
inlinenoexcept

Set the mask file path.

Parameters
mask_file_pathPath to the mask file
Returns
A reference to this configurator

◆ ensure_mask_source()

configurator & mazes::configurator::ensure_mask_source ( const std::string & mask_source)
inlinenoexcept

Set the mask source.

Parameters
mask_sourceFile path or inline mask string
Returns
A reference to this configurator

◆ ensure_rows()

configurator & mazes::configurator::ensure_rows ( const unsigned int rows)
inlinenoexcept

Set the number of rows.

Parameters
rowsThe number of rows (must be > 0, will be clamped to reasonable limits)
Returns
A reference to this configurator
Warning
Values will be clamped to prevent memory issues

◆ has_valid_dimensions()

bool mazes::configurator::has_valid_dimensions ( ) const
inlinenodiscardnoexcept

Validate all configuration values are within safe limits.

Returns
True if all values are valid, false if any are problematic

Checks for potential infinite loop conditions and memory issues

◆ levels()

unsigned int mazes::configurator::levels ( ) const
inlinenodiscardnoexcept

Get the number of levels.

Returns
The number of levels (guaranteed to be > 0)

◆ mask_file()

std::string mazes::configurator::mask_file ( ) const
inlinenodiscardnoexcept

Get the mask file path.

Returns
The configured mask source, or empty string if not set

◆ mask_source()

std::string mazes::configurator::mask_source ( ) const
inlinenodiscardnoexcept

Get the mask source.

Returns
The mask source, or empty string if not set

◆ rows()

unsigned int mazes::configurator::rows ( ) const
inlinenodiscardnoexcept

Get the number of rows.

Returns
The number of rows (guaranteed to be > 0)

The documentation for this class was generated from the following file: