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

#ifndef ReinforceCommandFactory_hpp
#define ReinforceCommandFactory_hpp

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

namespace shardok {

using Units = flatbuffers::Vector<const Unit *>;

class ReinforceCommandFactory : public CommandFactory {
private:
    const SettingsGetter settings;

public:
    explicit ReinforceCommandFactory(const SettingsGetter &getter) : settings(getter) {}

    [[nodiscard]] auto MakeReinforceCommand(
            PlayerId playerId,
            UnitId actingUnitId,
            UnitId joiningUnitId,
            const Coords &position) const -> CommandSPtr;

    auto AddAvailableReinforceCommands(
            CommandList &existingCommands,
            const Unit *reinforcingUnit,
            ActionPoints remainingActionPoints,
            const HexMap *hexMap,
            const Units *units) const -> void;

    void AddAvailableCommands(CommandList &commands, const CommandParams &params) const override;
};
}  // namespace shardok

#endif /* ReinforceCommandFactory_hpp */
