//
// Created by Dan Crosby on 11/29/20.
//

#ifndef EAGLE0_SHARDOK_LIBRARY_ACTION_FACTORIES_PLAYER_SETUP_COMMAND_FACTORY_HPP
#define EAGLE0_SHARDOK_LIBRARY_ACTION_FACTORIES_PLAYER_SETUP_COMMAND_FACTORY_HPP

#include <optional>
#include <vector>

#include "src/main/cpp/net/eagle0/shardok/library/GameStateW.hpp"
#include "src/main/cpp/net/eagle0/shardok/library/ShardokCommand.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 Unit = net::eagle0::shardok::storage::fb::Unit;

class PlayerSetupCommandFactory {
private:
    const SettingsGetter settings;

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

    auto AddAvailablePlaceAndHideUnitCommandsForOneUnit(
            CommandList& existingCommands,
            bool isDefender,
            const Unit* unit,
            const GameStateW& gameState) const -> void;

    auto AddAvailablePlayerSetupCommands(
            CommandList& existingCommands,
            PlayerId playerId,
            const GameStateW& gameState,
            const std::optional<std::vector<Coords>>& reinforcementPositions = std::nullopt) const
            -> void;
};

}  // namespace shardok

#endif  // EAGLE0_SHARDOK_LIBRARY_ACTION_FACTORIES_PLAYER_SETUP_COMMAND_FACTORY_HPP
