#ifndef ABILITYEFFECT_H
#define ABILITYEFFECT_H
#include <memory>
#include <string>
#include "LSObject.h"

class LSObject;

class AbilityEffect
{
public:
    explicit AbilityEffect(const std::shared_ptr<LSObject> &obj)
    {
        const auto optPercentSuccess = obj->GetMember("PercentSuccess");
        const auto optIndentation = obj->GetMember("Indentation");
        const auto optDescription = obj->GetMember("Description");
        percentSuccess = optPercentSuccess.has_value() ? optPercentSuccess->Int : 0;
        indentation = optIndentation.has_value() ? optIndentation->Int : 0;
        description = optDescription.has_value() ? optDescription->CharPtr : "";
    }

    int PercentSuccess() const
    {
        return percentSuccess;
    }

    int Indentation() const
    {
        return indentation;
    }

    std::string Description() const
    {
        return description;
    }

private:
    int percentSuccess;
    int indentation;
    std::string description;
};

#endif // ABILITYEFFECT_H
