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

#ifndef EAGLE0_HIDECOMMANDFACTORY_HPP
#define EAGLE0_HIDECOMMANDFACTORY_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"
#include "src/main/cpp/net/eagle0/shardok/library/unit/Unit.hpp"

namespace shardok {

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

    [[nodiscard]] auto MakeHideCommand(const Unit *actor, const Coords &target) const
            -> CommandSPtr;

    auto PositionIsHideable(
            const Unit *actor,
            CommandList &existingCommands,
            const HexMap *hexMap,
            const Coords &target,
            const Units *units,
            const std::vector<shardok::PlayerId> &allyPids) const -> bool;

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

    auto AddAvailableHideCommands(
            CommandList &existingCommands,
            const Unit *actor,
            ActionPoints remainingActionPoints,
            const Coords &position,
            const HexMap *hexMap,
            const Units *units,
            const vector<PlayerId> &allyPids) const -> void;

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

}  // namespace shardok

#endif  // EAGLE0_HIDECOMMANDFACTORY_HPP
