//
// Created by Dan Crosby on 2/15/21.
//

#ifndef EAGLE0_STARTFIRECOMMANDFACTORY_HPP
#define EAGLE0_STARTFIRECOMMANDFACTORY_HPP

#include <map>

#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/map/Coordinates.hpp"
#include "src/main/cpp/net/eagle0/shardok/library/settings/GameSettings.hpp"

namespace shardok {

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

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

public:
    explicit StartFireCommandFactory(const SettingsGetter &getter);

    [[nodiscard]] auto MakeStartFireCommand(
            const Unit *unit,
            const Coords &coords,
            const Terrain &targetTerrain,
            const PercentileRollOdds &odds) const -> CommandSPtr;

    auto AddAvailableStartFireCommands(
            CommandList &commands,
            const Unit *unit,
            const Units *units,
            vector<PlayerId> allyPids,
            const HexMap *hexMap,
            ActionPoints remainingActionPoints,
            const Coords &position,
            const WeatherFb *weather) const -> void;

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

#endif  // EAGLE0_STARTFIRECOMMANDFACTORY_HPP
