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

Configuration class for arguments. More...

#include <configurator.h>

Public Member Functions

configuratorensure_rows (const unsigned int rows) noexcept
 Set the number of rows.
 
configuratorensure_columns (const unsigned int columns) noexcept
 Set the number of columns.
 
configuratorensure_levels (const unsigned int levels) noexcept
 Set the number of levels.
 
configuratorensure_algo_id (const algo algorithm) noexcept
 Set the maze generation algorithm.
 
configuratorensure_block_id (const int block_id) noexcept
 Set the block ID.
 
configuratorensure_seed (const unsigned int seed) noexcept
 Set the random seed.
 
configuratorensure_distances (const bool distances) noexcept
 Set the distance calculation flag.
 
configuratorensure_distances_start (const int start_index) noexcept
 Set the distance start index.
 
configuratorensure_distances_end (const int end_index) noexcept
 Set the distance end index.
 
configuratorensure_output_format_id (const output_format output_format) noexcept
 Set the output_format ID.
 
configuratorensure_output_format_filename (const std::string &filename) noexcept
 Set the output filename.
 
configuratorensure_mask_filename (const std::string &filename) noexcept
 Set the mask filename.
 
configuratorset_help (bool help) noexcept
 Set the help flag.
 
configuratorset_version (bool version) noexcept
 Set the version flag.
 
configuratorshow_steps (bool show_steps) noexcept
 Set whether step snapshots should be shown during generation.
 
configuratorrows (const unsigned int r) noexcept
 
configuratorcolumns (const unsigned int c) noexcept
 
configuratorlevels (const unsigned int l) noexcept
 
configuratoralgo_id (const algo a) noexcept
 
configuratorseed (const unsigned int s) 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.
 
std::string mask_filename () const noexcept
 Get the mask filename.
 
int block_ID () const noexcept
 Get the block ID.
 
unsigned int seed () const noexcept
 Get the random seed.
 
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.
 
output_format output_format_id () const noexcept
 Get the output_format ID.
 
bool help () const noexcept
 
bool version () const noexcept
 
bool show_steps () const noexcept
 
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 = 10u
 
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

◆ block_ID()

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

Get the block ID.

Returns
The block ID

◆ 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_block_id()

configurator & mazes::configurator::ensure_block_id ( const int block_id)
inlinenoexcept

Set the block ID.

Parameters
block_idThe block ID
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_filename()

configurator & mazes::configurator::ensure_mask_filename ( const std::string & filename)
inlinenoexcept

Set the mask filename.

Parameters
filenameThe mask file path (.txt)
Returns
A reference to this configurator

◆ ensure_output_format_filename()

configurator & mazes::configurator::ensure_output_format_filename ( const std::string & filename)
inlinenoexcept

Set the output filename.

Parameters
filenameThe filename
Returns
A reference to this configurator

◆ ensure_output_format_id()

configurator & mazes::configurator::ensure_output_format_id ( const output_format output_format)
inlinenoexcept

Set the output_format ID.

Parameters
output_formatThe output_format ID
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

◆ ensure_seed()

configurator & mazes::configurator::ensure_seed ( const unsigned int seed)
inlinenoexcept

Set the random seed.

Parameters
seedThe random seed
Returns
A reference to this configurator

◆ 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_filename()

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

Get the mask filename.

Returns
The mask filename (empty string if not set)

◆ output_format_id()

output_format mazes::configurator::output_format_id ( ) const
inlinenodiscardnoexcept

Get the output_format ID.

Returns
The output_format ID

◆ rows()

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

Get the number of rows.

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

◆ seed()

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

Get the random seed.

Returns
The random seed

◆ set_help()

configurator & mazes::configurator::set_help ( bool help)
inlinenoexcept

Set the help flag.

Parameters
helpTrue to display help information
Returns
A reference to this configurator

◆ set_version()

configurator & mazes::configurator::set_version ( bool version)
inlinenoexcept

Set the version flag.

Parameters
versionTrue to display version information
Returns
A reference to this configurator

◆ show_steps()

configurator & mazes::configurator::show_steps ( bool show_steps)
inlinenoexcept

Set whether step snapshots should be shown during generation.

Parameters
show_stepsTrue to emit periodic maze snapshots
Returns
A reference to this configurator

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