//
//  EvacuatePrisonersCommand.hpp
//  eagle0
//

#ifndef EAGLE0_SHARDOK_LIBRARY_COMMANDS_EVACUATE_PRISONERS_COMMAND_HPP
#define EAGLE0_SHARDOK_LIBRARY_COMMANDS_EVACUATE_PRISONERS_COMMAND_HPP

#include <vector>

#include "src/main/cpp/net/eagle0/shardok/library/ActionCost.hpp"
#include "src/main/cpp/net/eagle0/shardok/library/ShardokCommand.hpp"

namespace shardok {
class EvacuatePrisonersCommand : public ShardokCommand {
protected:
    auto InternalExecute(
            const GameStateW& currentState,
            const std::shared_ptr<RandomGenerator>& generator) const
            -> vector<ActionResult> override;

    const ActionCost cost;
    const UnitId actorId;
    const std::vector<UnitId> captiveUnitIds;

public:
    EvacuatePrisonersCommand(
            const ActionCost& cost,
            PlayerId playerId,
            UnitId actorId,
            std::vector<UnitId> captiveUnitIds);

    ~EvacuatePrisonersCommand() override = default;

    [[nodiscard]] auto GetCommandType() const -> CommandType override {
        return net::eagle0::shardok::common::EVACUATE_PRISONERS_COMMAND;
    }

    [[nodiscard]] auto GetCommandProto() const -> CommandProto override;
    [[nodiscard]] auto GetOddsPercentile() const -> int32_t override { return 100; }
    [[nodiscard]] auto CanBeFollowUp() const -> bool override { return false; }
    [[nodiscard]] auto CanDoWithLowMorale() const -> bool override { return true; }

    [[nodiscard]] int GetActorUnitId() const override { return actorId; }
};
}  // namespace shardok

#endif  // EAGLE0_SHARDOK_LIBRARY_COMMANDS_EVACUATE_PRISONERS_COMMAND_HPP
