//
//  RetreatCommand.hpp
//  eagle0
//
//  Created by Dan Crosby on 12/30/19.
//  Copyright © 2019 none. All rights reserved.
//

#ifndef RetreatCommand_hpp
#define RetreatCommand_hpp

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

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

    const ActionCost cost;
    const UnitId retreatingUnitId;

public:
    RetreatCommand(const ActionCost& cost, PlayerId playerId, UnitId retreatingUnitId);
    ~RetreatCommand(){};

    virtual CommandType GetCommandType() const override {
        return net::eagle0::shardok::common::RETREAT_COMMAND;
    }

    virtual CommandProto GetCommandProto() const override;

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

#endif /* RetreatCommand_hpp */
