Loading...
Searching...
No Matches
FlagManager.h
Go to the documentation of this file.
1// Copyright (c) 2025 Dave R. Smith. All rights reserved.
2// Malena Framework — Proprietary Software. See LICENSE for terms.
3
4//
5// Created by Dave R. Smith on 3/4/25.
6//
7
8#ifndef MALENA_FLAGGABLE_H
9#define MALENA_FLAGGABLE_H
10
11#pragma once
12
14#include <map>
15#include <iostream>
18
19namespace ml
20{
58 template<typename StateEnum>
60 {
61 public:
63 using State = StateEnum;
64
65 private:
66 std::map<State, bool> _states;
67
68 public:
70 FlagManager(const FlagManager& stateful);
71
80 bool checkFlag(State state) const;
81
87 void enableFlag(State state);
88
94 void disableFlag(State state);
95
101 void toggleFlag(State state);
102
109 void setFlag(State state, bool status);
110 };
111
112} // namespace ml
113
114#include "../../../src/Resources/FlagManager.tpp"
115#endif // MALENA_FLAGGABLE_H
FlagManager(const FlagManager &stateful)
StateEnum State
The enum type this manager stores flags for.
Definition FlagManager.h:63
void toggleFlag(State state)
Flip a flag between true and false.
void disableFlag(State state)
Set a flag to false.
void setFlag(State state, bool status)
Set a flag to an explicit value.
bool checkFlag(State state) const
Return the current value of a flag.
void enableFlag(State state)
Set a flag to true.
Definition Component.h:22