Configuration class for arguments.
More...
#include <configurator.h>
|
|
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 |
Configuration class for arguments.
This class stores maze generation parameters with safe default values
◆ 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()
Set the maze generation algorithm.
- Parameters
-
| algorithm | The 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
-
| columns | The 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
-
| distances | The 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_index | The 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_index | The 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
-
| levels | The 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_path | Path 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_source | File 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
-
| rows | The 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: