#include "ActorTLO.h"

optional<Actor> ActorTLO::GetActorById(unsigned long id) const
{
    const auto command = "Actor[" + to_string(id) + "]";
    log << "ActorTLO::GetActorById: " << command << std::endl;

    const auto actor = LSObject::FromDataParse(command);
    if (actor.has_value())
    {
        return Actor(actor.value());
    }

    return nullopt;

    // log << "ActorTLO::GetActorById: " << id << std::endl;
    // LSOBJECT *actor = nullptr;
    // const auto result = isInterface->DataParse("Actor[" + to_string(id) + "]", actor);

    // if (!actor)
    // {
    //     return nullopt;
    // }
    // return Actor(make_shared<LSObject>(actor));
}

optional<Actor> ActorTLO::GetActorByName(const std::string &name) const
{
    return nullopt;
    // log << "ActorTLO::GetActorByName: " << name << std::endl;
    // return nullopt;
    // const auto actor = this->lsObject->GetMember("Actor", "Name =- " + name);
    // if (!actor.has_value())
    // {
    //     logw << "ActorTLO::GetActorByName: Actor not found: " << name << std::endl;
    //     return nullopt;
    // }

    // return Actor(make_shared<LSObject>(actor));
}
