Maze Builder Docs 8.10.23
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 <vector>
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 , PRIMS = 3 ,
  TOTAL = 4
}
 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",
"prims"}

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