Configuration class for arguments.
More...
#include <configurator.h>
|
|
static constexpr auto | DEFAULT_ROWS = 10u |
| |
|
static constexpr auto | DEFAULT_COLUMNS = 10u |
| |
|
static constexpr auto | DEFAULT_LEVELS = 1u |
| |
|
static constexpr auto | DEFAULT_BLOCK_ID = 0 |
| |
|
static constexpr auto | DEFAULT_ALGO_ID = algo::BINARY_TREE |
| |
|
static constexpr auto | DEFAULT_SEED = 0u |
| |
|
static constexpr auto | DEFAULT_OUTPUT_ID = output_format::PLAIN_TEXT |
| |
|
static constexpr auto | DEFAULT_FILENAME = "" |
| |
|
static constexpr auto | DEFAULT_DISTANCES = false |
| |
|
static constexpr auto | DEFAULT_DISTANCES_START = 0 |
| |
|
static constexpr auto | DEFAULT_DISTANCES_END = -1 |
| |
|
static constexpr auto | MAX_ROWS = 100u |
| |
|
static constexpr auto | MAX_COLUMNS = 100u |
| |
|
static constexpr auto | MAX_LEVELS = 10u |
| |
Configuration class for arguments.
This class stores maze generation parameters with safe default values
◆ algo_id() [1/2]
| algo mazes::configurator::algo_id |
( |
| ) |
const |
|
inlinenoexcept |
Get the maze generation algorithm.
- Returns
- The algorithm used for maze generation
◆ algo_id() [2/2]
Set the maze generation algorithm.
- Parameters
-
| algorithm | The algorithm to use |
- Returns
- A reference to this configurator
◆ block_id() [1/2]
| int mazes::configurator::block_id |
( |
| ) |
const |
|
inlinenoexcept |
Get the block ID.
- Returns
- The block ID
◆ block_id() [2/2]
| configurator & mazes::configurator::block_id |
( |
int | block_id | ) |
|
|
inlinenoexcept |
Set the block ID.
- Parameters
-
- Returns
- A reference to this configurator
◆ columns() [1/2]
| unsigned int mazes::configurator::columns |
( |
| ) |
const |
|
inlinenoexcept |
Get the number of columns.
- Returns
- The number of columns (guaranteed to be > 0)
◆ columns() [2/2]
| configurator & mazes::configurator::columns |
( |
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
◆ distances() [1/2]
| bool mazes::configurator::distances |
( |
| ) |
const |
|
inlinenoexcept |
Check if distances are calculated.
- Returns
- True if distances are calculated, false otherwise
◆ distances() [2/2]
| configurator & mazes::configurator::distances |
( |
bool | distances | ) |
|
|
inlinenoexcept |
Set the distance calculation flag.
- Parameters
-
| distances | The distance calculation flag |
- Returns
- A reference to this configurator
◆ distances_end() [1/2]
| int mazes::configurator::distances_end |
( |
| ) |
const |
|
inlinenoexcept |
Get the distance end index.
- Returns
- The ending cell index for distance calculation
◆ distances_end() [2/2]
| configurator & mazes::configurator::distances_end |
( |
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
◆ distances_start() [1/2]
| int mazes::configurator::distances_start |
( |
| ) |
const |
|
inlinenoexcept |
Get the distance start index.
- Returns
- The starting cell index for distance calculation
◆ distances_start() [2/2]
| configurator & mazes::configurator::distances_start |
( |
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
◆ is_valid()
| bool mazes::configurator::is_valid |
( |
| ) |
const |
|
inlinenoexcept |
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() [1/2]
| unsigned int mazes::configurator::levels |
( |
| ) |
const |
|
inlinenoexcept |
Get the number of levels.
- Returns
- The number of levels (guaranteed to be > 0)
◆ levels() [2/2]
| configurator & mazes::configurator::levels |
( |
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
◆ make_algo_from_config()
| static std::optional< std::unique_ptr< algo_interface > > mazes::configurator::make_algo_from_config |
( |
const configurator & | config | ) |
|
|
inlinestatic |
Determine the maze generation algorithm from the configuration.
- Parameters
-
| config | The configurator containing the algorithm settings |
- Returns
- A unique pointer to the selected algorithm interface
◆ output_format_filename() [1/2]
| std::string mazes::configurator::output_format_filename |
( |
| ) |
const |
|
inlinenoexcept |
Get the output_format filename.
- Returns
- The output_format filename
◆ output_format_filename() [2/2]
| configurator & mazes::configurator::output_format_filename |
( |
std::string | filename | ) |
|
|
inlinenoexcept |
Set the output_format filename.
- Parameters
-
| filename | The output_format filename |
- Returns
- A reference to this configurator
◆ output_format_id() [1/2]
Get the output_format ID.
- Returns
- The output_format ID
◆ output_format_id() [2/2]
Set the output_format ID.
- Parameters
-
| output_format | The output_format ID |
- Returns
- A reference to this configurator
◆ rows() [1/2]
| unsigned int mazes::configurator::rows |
( |
| ) |
const |
|
inlinenoexcept |
Get the number of rows.
- Returns
- The number of rows (guaranteed to be > 0)
◆ rows() [2/2]
| configurator & mazes::configurator::rows |
( |
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 be clamped to prevent memory issues
◆ seed() [1/2]
| unsigned int mazes::configurator::seed |
( |
| ) |
const |
|
inlinenoexcept |
Get the random seed.
- Returns
- The random seed
◆ seed() [2/2]
| configurator & mazes::configurator::seed |
( |
unsigned int | seed | ) |
|
|
inlinenoexcept |
Set the random seed.
- Parameters
-
| seed | The random seed (0 = use random seed) |
- Returns
- A reference to this configurator
The documentation for this class was generated from the following file: