//
// Shardok-specific action adapter for MCTS
//

#ifndef EAGLE0_SHARDOK_ACTION_HPP
#define EAGLE0_SHARDOK_ACTION_HPP

#include <memory>
#include <string>

#include "src/main/cpp/net/eagle0/common/mcts/abstract/MCTSAction.hpp"

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
#include "src/main/protobuf/net/eagle0/shardok/api/command_descriptor.pb.h"
#pragma clang diagnostic pop

namespace shardok {
namespace mcts {

class ShardokAction : public MCTSAction {
public:
    using CommandProto = net::eagle0::shardok::api::CommandDescriptor;

    ShardokAction(const CommandProto& command, size_t index);
    ShardokAction(CommandProto&& command, size_t index);

    // MCTSAction interface implementation
    [[nodiscard]] size_t getIndex() const override { return commandIndex_; }
    [[nodiscard]] std::string getDescription() const override;
    [[nodiscard]] std::unique_ptr<MCTSAction> clone() const override;
    [[nodiscard]] bool equals(const MCTSAction& other) const override;

    // Shardok-specific methods (not part of abstract interface)
    [[nodiscard]] int getType() const;
    [[nodiscard]] int getActorId() const;
    [[nodiscard]] std::pair<int, int> getTarget() const;

    // Shardok-specific accessor
    [[nodiscard]] const CommandProto& getCommand() const { return command_; }

private:
    CommandProto command_;
    size_t commandIndex_;
};

}  // namespace mcts
}  // namespace shardok

#endif  // EAGLE0_SHARDOK_ACTION_HPP