StateToIdMap.ixx File
Policy mapping states to IDs. More...
Included Headers
#include <vector>
#include <span>
#include <helios/helios_config.h>
#include <cassert>
#include <bit>
#include <algorithm>
#include <helios.core.types>
#include <helios.engine.common.types.ViewportId>
#include <helios.engine.mechanics.match.types>
#include <helios.engine.state.types>
Namespaces Index
| namespace | helios |
| namespace | engine |
|
Main engine module aggregating core infrastructure and game systems. More... | |
| namespace | state |
|
Generic, template-based state management system. More... | |
Classes Index
| class | StateToIdMap<TState, TId> |
|
Maps state enum values to lists of IDs. More... | |
Description
Policy mapping states to IDs.
File Listing
The file content with the documentation metadata removed is:
23using namespace helios::engine::common::types;
24using namespace helios::engine::state::types;
25using namespace helios::engine::mechanics::match::types;
27export namespace helios::engine::state {
41 class StateToIdMap {
89 StateToIdMap() {
101 StateToIdMap& add(TState state, TId id) noexcept {
104 const auto st = static_cast<size_t>(std::to_underlying(state));
139 finalize();
153 if (std::to_underlying(state) == 0) {
157 assert((std::to_underlying(state) & (std::to_underlying(state) -1)) == 0 && "State must be a power of 2");
159 const auto stateIdx = static_cast<size_t>(std::countr_zero(std::to_underlying(state)));
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.