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

#ifndef EAGLE0_METEORCANCELCOMMAND_HPP
#define EAGLE0_METEORCANCELCOMMAND_HPP

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

namespace shardok {

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

    const ActionCost cost;
    const SettingsGetter settings;
    const UnitId casterId;

public:
    MeteorCancelCommand(
            const ActionCost &cost,
            const SettingsGetter &settingsGetter,
            PlayerId playerId,
            UnitId casterId);

    ~MeteorCancelCommand() override = default;

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

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

#endif  // EAGLE0_METEORCANCELCOMMAND_HPP
