Maze Builder Docs 8.2.1
Loading...
Searching...
No Matches
algos.h File Reference
#include <algorithm>
#include <array>
#include <ranges>
#include <stdexcept>
#include <string>
#include <string_view>
#include <type_traits>
#include <utility>
Include dependency graph for algos.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum class  mazes::algo : unsigned int {
  BINARY_TREE = 0 , SIDEWINDER = 1 , DFS = 2 , PIXELS = 3 ,
  STRINGIFY = 4 , WAVEFRONT_OBJECT = 5 , TOTAL = 6
}
 Enumeration of maze generation algorithms.
 

Functions

std::string_view mazes::to_sv_from_algo (algo a)
 Convert the algo enum to a string_view.
 
algo mazes::to_algo_from_sv (std::string_view a)
 Convert a string_view to an algo enum.
 

Variables

constexpr std::array< std::string_view, static_cast< size_t >(algo::TOTAL)> mazes::ALGOS_LABELS_LOWERCASE
 Array of string_view labels for the algo enum, in lowercase.
 

Function Documentation

◆ to_algo_from_sv()

algo mazes::to_algo_from_sv ( std::string_view a)
inline

Convert a string_view to an algo enum.

Parameters
a
Returns
algo

◆ to_sv_from_algo()

std::string_view mazes::to_sv_from_algo ( algo a)
inline

Convert the algo enum to a string_view.

Parameters
a
Returns

Variable Documentation

◆ ALGOS_LABELS_LOWERCASE

std::array<std::string_view, static_cast<size_t>(algo::TOTAL)> mazes::ALGOS_LABELS_LOWERCASE
constexpr
Initial value:
= {
"binary_tree",
"sidewinder",
"dfs",
"pixels",
"stringify",
"wavefront_object"
}

Array of string_view labels for the algo enum, in lowercase.