38 lines
1.2 KiB
C++
38 lines
1.2 KiB
C++
#ifndef CREATURELIB_SECONDARYEFFECT_HPP
|
|
#define CREATURELIB_SECONDARYEFFECT_HPP
|
|
|
|
#include <Arbutils/Collections/List.hpp>
|
|
#include <Arbutils/ConstString.hpp>
|
|
#include <any>
|
|
#include "../EffectParameter.hpp"
|
|
|
|
using namespace Arbutils::Collections;
|
|
namespace CreatureLib::Library {
|
|
class SecondaryEffect {
|
|
private:
|
|
float _chance;
|
|
Arbutils::CaseInsensitiveConstString _effectName;
|
|
List<EffectParameter*> _parameters;
|
|
|
|
public:
|
|
SecondaryEffect() noexcept : _chance(0), _effectName() {}
|
|
SecondaryEffect(float chance, const Arbutils::CaseInsensitiveConstString& effectName,
|
|
const List<EffectParameter*>& parameters) noexcept
|
|
: _chance(chance), _effectName(effectName), _parameters(parameters) {}
|
|
|
|
~SecondaryEffect() {
|
|
for (auto p : _parameters) {
|
|
delete p;
|
|
}
|
|
}
|
|
|
|
constexpr inline float GetChance() const noexcept { return _chance; }
|
|
constexpr inline const Arbutils::CaseInsensitiveConstString& GetEffectName() const noexcept {
|
|
return _effectName;
|
|
}
|
|
const inline List<EffectParameter*>& GetParameters() const noexcept { return _parameters; }
|
|
};
|
|
}
|
|
|
|
#endif // CREATURELIB_SECONDARYEFFECT_HPP
|