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

#ifndef ReinforceCommand_hpp
#define ReinforceCommand_hpp

#include <utility>

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

namespace shardok {

using Unit = net::eagle0::shardok::storage::fb::Unit;

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

    const ActionCost cost;
    const UnitId actingUnitId;
    const UnitId joiningUnitId;
    const Coords location;

public:
    ReinforceCommand(
            const ActionCost& cost,
            const PlayerId playerId,
            const UnitId actingUnitId,
            const UnitId joiningUnitId,
            const Coords reinforcePosition)
        : ShardokCommand(playerId),
          cost(cost),
          actingUnitId(actingUnitId),
          joiningUnitId(joiningUnitId),
          location(reinforcePosition) {}

    ~ReinforceCommand() override = default;

    auto GetCommandType() const -> CommandType override {
        return net::eagle0::shardok::common::REINFORCE_COMMAND;
    }

    auto GetCommandProto() const -> CommandProto override;

    [[nodiscard]] auto IsRequiredToEndTurn() const -> bool override { return false; }
    [[nodiscard]] auto CanBeFollowUp() const -> bool override { return true; }
    [[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; }
};
}  // namespace shardok

#endif /* ReinforceCommand_hpp */
