//
//  BecomeOutlawCommand.hpp
//  eagle0
//
//  Created by Dan Crosby on 2021/06/13.
//  Copyright © 2021 none. All rights reserved.
//

#ifndef GoIntoExileCommand_hpp
#define GoIntoExileCommand_hpp

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

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

    const ActionCost cost;
    const UnitId fleeingUnitId;
    const PercentileRollOdds successOdds;

public:
    BecomeOutlawCommand(
            const ActionCost& cost,
            PlayerId playerId,
            UnitId fleeingUnitId,
            PercentileRollOdds odds);

    ~BecomeOutlawCommand() override = default;

    [[nodiscard]] auto ExecuteWithRoll(const GameStateW& currentState, double roll) const
            -> vector<ActionResult>;

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

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

#endif /* GoIntoExileCommand_hpp */
