//
// Created by marob on 12/27/2023.
//

#include "Ability.h"

#include <memory>


u_long Ability::Id() const {
    return {static_cast<u_long>(this->lsObject->GetMember("ID").Int64)};
}

bool Ability::IsReady() const {
    return this->lsObject->GetMember("IsReady").Int;
}

float Ability::TimeUntilReady() const {
    return this->lsObject->GetMember("TimeUntilReady").Float;
}

bool Ability::IsQueued() const {
    return this->lsObject->GetMember("IsQueued").Int;
}

bool Ability::IsAbilityInfoAvailable() const {
    return this->lsObject->GetMember("IsAbilityInfoAvailable").Int;
}

AbilityInfo Ability::GetAbilityInfo() const {
    return AbilityInfo(make_shared<LSObject>(this->lsObject->GetMember("ToAbilityInfo")));
}

void Ability::Use() const {
    this->lsObject->CallMethod("Use");
}

void Ability::Examine() const {
    this->lsObject->CallMethod("Examine");
}
