Manifest for the Draggable trait.
More...
#include <Draggable.h>
|
| template<typename ConfigType, typename ValueType> |
| static const ValueType & | getConfig (ConfigType config) |
| | Retrieve a typed configuration value by enum key.
|
| template<typename Asset> |
| static const std::string & | getFilepath (const Asset &asset) |
| | Retrieve the file path registered for an asset enum value.
|
|
| template<typename E, typename V, typename... Args> |
| static void | set (E key, V &&value, Args &&... args) |
| | Register multiple key-value pairs in one call.
|
| template<typename EnumType> |
| static void | set (EnumType key, const char *filepath) |
| | Register an asset file path.
|
| template<typename EnumType> |
| static void | set (EnumType key, std::string value) |
| | Register a string configuration value.
|
| template<typename EnumType, typename ValueType> |
| static std::enable_if_t< !std::is_same_v< std::decay_t< ValueType >, const char * > &&!std::is_same_v< std::decay_t< ValueType >, std::string > > | set (EnumType key, ValueType &&value) |
| | Register a typed configuration value (int, float, bool, etc.).
|
Manifest for the Draggable trait.
Definition at line 25 of file Draggable.h.
◆ Flag
| Enumerator |
|---|
| DRAGGING | Set while the user is actively dragging.
|
Definition at line 35 of file Draggable.h.
◆ State
| Enumerator |
|---|
| FREE | Drag freely on both axes (default).
|
| LOCK_X | Lock horizontal — drag Y axis only.
|
| LOCK_Y | Lock vertical — drag X axis only.
|
Definition at line 28 of file Draggable.h.
◆ getConfig()
template<typename ConfigType, typename ValueType>
| const ValueType & ml::Manifest::getConfig |
( |
ConfigType | config | ) |
|
|
staticinherited |
Retrieve a typed configuration value by enum key.
Looks up the value previously registered via set(key, value) where value was not a file path. Throws if the key has not been registered.
- Template Parameters
-
| ConfigType | An enum type declared inside a Manifest subclass. |
| ValueType | The type of the stored value (e.g., int, float, std::string). |
- Parameters
-
| config | The specific enum value to look up. |
- Returns
- Const reference to the registered configuration value.
◆ getFilepath()
template<typename Asset>
| const std::string & ml::Manifest::getFilepath |
( |
const Asset & | asset | ) |
|
|
staticinherited |
Retrieve the file path registered for an asset enum value.
Looks up the path previously registered via set(key, filepath). Throws std::out_of_range if the key has not been registered.
- Template Parameters
-
| Asset | An enum type declared inside a Manifest subclass. |
- Parameters
-
| asset | The specific enum value to look up. |
- Returns
- Const reference to the registered file path string.
◆ set() [1/4]
template<typename E, typename V, typename... Args>
| void ml::Manifest::set |
( |
E | key, |
|
|
V && | value, |
|
|
Args &&... | args ) |
|
staticprotectedinherited |
Register multiple key-value pairs in one call.
Variadic overload that expands to successive set() calls. Useful for batch registration in the inline static initializer:
set(Images::Background,
"assets/bg.png",
Images::Button, "assets/btn.png",
Fonts::Main, "assets/main.ttf");
static void set(EnumType key, const char *filepath)
Register an asset file path.
- Template Parameters
-
| E | First key type. |
| V | First value type. |
| Args | Remaining key-value pairs. |
◆ set() [2/4]
template<typename EnumType>
| void ml::Manifest::set |
( |
EnumType | key, |
|
|
const char * | filepath ) |
|
staticprotectedinherited |
Register an asset file path.
Associates key with a file path. The path is later retrieved by ResourceManager when loading the asset.
- Template Parameters
-
| EnumType | Enum type of the key (inferred). |
- Parameters
-
| key | The enum value to register. |
| filepath | Null-terminated path to the asset file. |
◆ set() [3/4]
template<typename EnumType>
| void ml::Manifest::set |
( |
EnumType | key, |
|
|
std::string | value ) |
|
staticprotectedinherited |
Register a string configuration value.
Associates key with a std::string config value. Distinct from the file-path overload — an explicit std::string signals that this is configuration data, not a resource path.
- Template Parameters
-
| EnumType | Enum type of the key (inferred). |
- Parameters
-
| key | The enum value to register. |
| value | The string configuration value. |
◆ set() [4/4]
template<typename EnumType, typename ValueType>
| std::enable_if_t< !std::is_same_v< std::decay_t< ValueType >, const char * > &&!std::is_same_v< std::decay_t< ValueType >, std::string > > ml::Manifest::set |
( |
EnumType | key, |
|
|
ValueType && | value ) |
|
staticprotectedinherited |
Register a typed configuration value (int, float, bool, etc.).
Enabled for any ValueType that is not const char* or std::string, routing numeric and boolean config values into their own type-indexed storage.
- Template Parameters
-
| EnumType | Enum type of the key (inferred). |
| ValueType | Type of the configuration value (inferred). |
- Parameters
-
| key | The enum value to register. |
| value | The configuration value. |
The documentation for this class was generated from the following file: