Adds secondary effect parameter system.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-04-10 16:35:24 +02:00
parent 141b8bbc5b
commit e89d2a9e0c
3 changed files with 26 additions and 8 deletions

View File

@@ -1,20 +1,27 @@
#ifndef CREATURELIB_SECONDARYEFFECT_HPP
#define CREATURELIB_SECONDARYEFFECT_HPP
#include <Arbutils/Collections/List.hpp>
#include <Arbutils/ConstString.hpp>
#include <any>
using namespace Arbutils::Collections;
namespace CreatureLib::Library {
class SecondaryEffect {
private:
float _chance;
Arbutils::CaseInsensitiveConstString _effectName;
List<void*> _parameters;
public:
SecondaryEffect() noexcept : _chance(0), _effectName(Arbutils::CaseInsensitiveConstString("")) {}
SecondaryEffect(float chance, const Arbutils::CaseInsensitiveConstString& effectName) noexcept
: _chance(chance), _effectName(effectName) {}
SecondaryEffect(float chance, const Arbutils::CaseInsensitiveConstString& effectName,
const List<void*>& parameters) noexcept
: _chance(chance), _effectName(effectName), _parameters(parameters) {}
constexpr float GetChance() const noexcept { return _chance; }
constexpr const Arbutils::CaseInsensitiveConstString& GetEffectName() const noexcept { return _effectName; }
const List<void*>& GetParameters() const noexcept { return _parameters; }
};
}