//
// Created by Dan Crosby on 3/4/21.
//

#ifndef EAGLE0_SHARDOK_LIBRARY_COMMANDS_FORTIFY_COMMAND_HPP
#define EAGLE0_SHARDOK_LIBRARY_COMMANDS_FORTIFY_COMMAND_HPP

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

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

    const ActionCost cost;
    const UnitId fortifyingUnitId;
    const int strengthXp;
    const int agilityXp;
    const int minimumKnowledgeAfter;

public:
    FortifyCommand(
            const ActionCost& cost,
            PlayerId playerId,
            UnitId fortifyingUnitId,
            int strengthXp,
            int agilityXp,
            int professionKnowledgeBump);

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

    [[nodiscard]] auto GetCommandProto() const -> CommandProto override;

    [[nodiscard]] int GetActorUnitId() const override { return fortifyingUnitId; }
};
}  // namespace shardok

#endif  // EAGLE0_SHARDOK_LIBRARY_COMMANDS_FORTIFY_COMMAND_HPP
