36#include "../../third_party/nlohmann/json.hpp"
183 bool Load(
const std::string& filepath);
205 bool Save(
const std::string& filepath)
const;
Defines ConditionPreset — a reusable, globally-stored condition expression.
ComponentTypeID GetComponentTypeID_Static()
Manages the global pool of ConditionPreset objects.
void LoadFromPresetList(const std::vector< ConditionPreset > &presets)
Loads presets from a vector of ConditionPreset objects (clears existing data first).
size_t GetPresetCount() const
Returns the total number of presets in the registry.
void DeletePreset(const std::string &id)
Removes a preset from the registry.
static std::string GenerateID()
Generates a new UUID suitable for a preset ID.
std::map< std::string, ConditionPreset > m_presets
UUID -> ConditionPreset.
std::vector< std::string > m_order
UUIDs in insertion order.
void UpdatePreset(const std::string &id, const ConditionPreset &updated)
Replaces the data of an existing preset (id must already exist).
void Clear()
Clears all presets and resets error state.
ConditionPresetRegistry(const ConditionPresetRegistry &)=delete
std::vector< std::string > GetAllPresetIDs() const
Returns all preset UUIDs in display order.
bool ValidatePresetID(const std::string &id) const
Returns true when a preset with the given UUID exists.
ConditionPresetRegistry()=default
std::vector< std::string > m_errors
Accumulated error messages.
std::string CreatePreset(const ConditionPreset &preset)
Adds a preset to the registry.
std::string DuplicatePreset(const std::string &id)
Creates an independent copy of an existing preset with a new UUID.
bool Save(const std::string &filepath) const
Saves all presets to a JSON file.
std::vector< ConditionPreset > GetFilteredPresets(const std::string &filter) const
Returns all presets whose name contains the filter substring.
std::vector< std::string > GetAllErrors() const
Returns all error messages accumulated since the last Clear().
bool Load(const std::string &filepath)
Loads presets from a JSON file (clears existing data first).
ConditionPresetRegistry & operator=(const ConditionPresetRegistry &)=delete
std::vector< std::string > FindPresetsByName(const std::string &substring) const
Returns UUIDs of all presets whose name contains a substring.
ConditionPreset * GetPreset(const std::string &id)
Returns a mutable pointer to the preset, or nullptr if not found.
< Provides AssetID and INVALID_ASSET_ID
A globally-stored, reusable condition expression.