#pragma once #include #include #include #include #include "ModifierInstance.h" #include "ModifierScale.h" namespace nejlika { enum ModifierTemplateSelector : uint8_t { One, All, Two }; class ModifierTemplate { public: ModifierTemplate( const std::vector& types, ModifierTemplateSelector selector, ModifierCategory category, bool isResistance, uint32_t effectID, const std::string& effectType ) : types(types), selector(selector), category(category), isResistance(isResistance), effectID(effectID), effectType(effectType) {} /** * @brief Construct a new Modifier Template object from a json configuration. * * @param config The json configuration. */ ModifierTemplate(const nlohmann::json& config); /** * @brief Convert the modifier template to a json representation. * * @return The json representation. */ nlohmann::json ToJson() const; std::vector GenerateModifiers(int32_t level) const; // Getters and setters const std::vector& GetTypes() const { return types; } ModifierTemplateSelector GetSelector() const { return selector; } const std::vector& GetScales() const { return scales; } ModifierCategory GetCategory() const { return category; } bool IsResistance() const { return isResistance; } uint32_t GetEffectID() const { return effectID; } std::string GetEffectType() const { return effectType; } void SetTypes(const std::vector& types) { this->types = types; } void SetSelector(ModifierTemplateSelector selector) { this->selector = selector; } void SetScales(const std::vector& scales) { this->scales = scales; } void SetCategory(ModifierCategory category) { this->category = category; } void SetIsResistance(bool isResistance) { this->isResistance = isResistance; } void SetEffectID(uint32_t effectID) { this->effectID = effectID; } void SetEffectType(const std::string& effectType) { this->effectType = effectType; } private: std::optional GenerateModifier(ModifierType type, int32_t level) const; std::vector types; ModifierTemplateSelector selector; std::vector scales; ModifierCategory category; ModifierOperator operatorType; bool isResistance; uint32_t effectID; std::string effectType; }; }