//
// Created by Dan Crosby on 5/31/20.
//

#ifndef EAGLE0_UNITRESTCOMMAND_HPP
#define EAGLE0_UNITRESTCOMMAND_HPP

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

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

    const UnitId actorId;
    const double actionCostToVigorCost;
    const bool adjustsMorale;

public:
    UnitRestCommand(
            const PlayerId playerId,
            const UnitId actorId,
            const double actionCostToVigorCost,
            const bool adjustsMorale)
        : ShardokCommand(playerId),
          actorId(actorId),
          actionCostToVigorCost(actionCostToVigorCost),
          adjustsMorale(adjustsMorale){};

    ~UnitRestCommand() override = default;

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

    [[nodiscard]] auto GetCommandProto() const -> CommandProto override;
    [[nodiscard]] auto CanBeFollowUp() const -> bool override { return false; };
    [[nodiscard]] auto CanDoAfterMovingIntoZoc() const -> bool override { return true; }
    [[nodiscard]] auto IsRequiredToEndTurn() const -> bool override { return true; }
};
}  // namespace shardok

#endif  // EAGLE0_UNITRESTCOMMAND_HPP
