#ifndef ABILITYINFO_H
#define ABILITYINFO_H
#include <memory>

#include "CharacterClass.h"
#include "LSObject.h"


class AbilityInfo {
public:
    explicit AbilityInfo(const std::shared_ptr<LSObject> &obj) : lsObject(obj) {
        this->name = this->lsObject->GetMember("Name").CharPtr;
        this->description = this->lsObject->GetMember("Description").CharPtr;
        this->tier = this->lsObject->GetMember("Tier").CharPtr;
        this->healthCost = this->lsObject->GetMember("HealthCost").Int;
        this->powerCost = this->lsObject->GetMember("PowerCost").Int;
        this->dissonanceCost = this->lsObject->GetMember("DissonanceCost").Int;
        this->savageryCost = this->lsObject->GetMember("SavageryCost").Int;
        this->concentrationCost = this->lsObject->GetMember("ConcentrationCost").Int;
        this->mainIconID = this->lsObject->GetMember("MainIconID").Int;
        this->hOIconID = this->lsObject->GetMember("HOIconID").Int;
        this->castingTime = this->lsObject->GetMember("CastingTime").Float;
        this->recoveryTime = this->lsObject->GetMember("RecoveryTime").Float;
        this->recastTime = this->lsObject->GetMember("RecastTime").Float;
        this->maxDuration = this->lsObject->GetMember("MaxDuration").Float;
        this->numClasses = this->lsObject->GetMember("NumClasses").Int;
        this->numEffects = this->lsObject->GetMember("NumEffects").Int;
        this->backDropIconID = this->lsObject->GetMember("BackdropIconID").Int;
        this->healthCostPerTick = this->lsObject->GetMember("HealthCostPerTick").Int;
        this->powerCostPerTick = this->lsObject->GetMember("PowerCostPerTick").Int;
        this->dissonanceCostPerTick = this->lsObject->GetMember("DissonanceCostPerTick").Int;
        this->savageryCostPerTick = this->lsObject->GetMember("SavageryCostPerTick").Int;
        this->maxAOETargets = this->lsObject->GetMember("MaxAOETargets").Int;
        this->doesNotExpire = this->lsObject->GetMember("DoesNotExpire").Int;
        this->groupRestricted = this->lsObject->GetMember("GroupRestricted").Int;
        this->allowRaid = this->lsObject->GetMember("AllowRaid").Int;
        this->isBeneficial = this->lsObject->GetMember("IsBeneficial").Int;
        this->effectRadius = this->lsObject->GetMember("EffectRadius").Float;
        this->targetType = this->lsObject->GetMember("TargetType").Int;
        this->spellBookType = this->lsObject->GetMember("SpellBookType").Int;
        this->minRange = this->lsObject->GetMember("MinRange").Float;
        this->maxRange = this->lsObject->GetMember("MaxRange").Float;
        this->toLink = this->lsObject->GetMember("ToLink").CharPtr;
    }

    // CharacterClass classByIndex(const int num);
    //
    // CharacterClass classByName(const string &name);

    string Name() const;

    string Description() const;

    [[nodiscard]] string tier1() const {
        return tier;
    }

    [[nodiscard]] int health_cost() const {
        return healthCost;
    }

    [[nodiscard]] int power_cost() const {
        return powerCost;
    }

    [[nodiscard]] int dissonance_cost() const {
        return dissonanceCost;
    }

    [[nodiscard]] int savagery_cost() const {
        return savageryCost;
    }

    [[nodiscard]] int concentration_cost() const {
        return concentrationCost;
    }

    [[nodiscard]] int main_icon_id() const {
        return mainIconID;
    }

    [[nodiscard]] int h_o_icon_id() const {
        return hOIconID;
    }

    [[nodiscard]] float casting_time() const {
        return castingTime;
    }

    [[nodiscard]] float recovery_time() const {
        return recoveryTime;
    }

    [[nodiscard]] float recast_time() const {
        return recastTime;
    }

    [[nodiscard]] float max_duration() const {
        return maxDuration;
    }

    [[nodiscard]] int num_classes() const {
        return numClasses;
    }

    [[nodiscard]] int num_effects() const {
        return numEffects;
    }

    [[nodiscard]] int back_drop_icon_id() const {
        return backDropIconID;
    }

    [[nodiscard]] int health_cost_per_tick() const {
        return healthCostPerTick;
    }

    [[nodiscard]] int power_cost_per_tick() const {
        return powerCostPerTick;
    }

    [[nodiscard]] int dissonance_cost_per_tick() const {
        return dissonanceCostPerTick;
    }

    [[nodiscard]] int savagery_cost_per_tick() const {
        return savageryCostPerTick;
    }

    [[nodiscard]] int max_aoe_targets() const {
        return maxAOETargets;
    }

    [[nodiscard]] bool does_not_expire() const {
        return doesNotExpire;
    }

    [[nodiscard]] bool group_restricted() const {
        return groupRestricted;
    }

    [[nodiscard]] bool allow_raid() const {
        return allowRaid;
    }

    [[nodiscard]] bool is_beneficial() const {
        return isBeneficial;
    }

    [[nodiscard]] float effect_radius() const {
        return effectRadius;
    }

    [[nodiscard]] int target_type() const {
        return targetType;
    }

    [[nodiscard]] int spell_book_type() const {
        return spellBookType;
    }

    [[nodiscard]] float min_range() const {
        return minRange;
    }

    [[nodiscard]] float max_range() const {
        return maxRange;
    }

    [[nodiscard]] string to_link() const {
        return toLink;
    }

    [[nodiscard]] std::shared_ptr<LSObject> ls_object() const {
        return lsObject;
    }

private:
    string name;
    string description;
    string tier;
    int healthCost;
    int powerCost;
    int dissonanceCost;
    int savageryCost;
    int concentrationCost;
    int mainIconID;
    int hOIconID;
    float castingTime;
    float recoveryTime;
    float recastTime;
    float maxDuration;
    int numClasses;
    int numEffects;
    //AbilityEffect Effect[#]
    int backDropIconID;
    int healthCostPerTick;
    int powerCostPerTick;
    int dissonanceCostPerTick;
    int savageryCostPerTick;
    int maxAOETargets;
    bool doesNotExpire;
    bool groupRestricted;
    bool allowRaid;
    bool isBeneficial;
    float effectRadius;
    int targetType;
    int spellBookType;
    float minRange;
    float maxRange;
    string toLink;

    const std::shared_ptr<LSObject> lsObject;
};


#endif //ABILITYINFO_H
