//
// AIClientFactory - Unified factory for creating ShardokAIClient instances
// Used by both AI Performance Runner and AI Battle Simulator
//

#ifndef EAGLE0_AI_CLIENT_FACTORY_HPP
#define EAGLE0_AI_CLIENT_FACTORY_HPP

#include <memory>

#include "src/main/cpp/net/eagle0/shardok/ai/AIConfig.hpp"
#include "src/main/cpp/net/eagle0/shardok/library/ShardokCTypes.h"
#include "src/main/cpp/net/eagle0/shardok/library/settings/GameSettings.hpp"

// Forward declarations for flatbuffer types
namespace net {
namespace eagle0 {
namespace shardok {
namespace storage {
namespace fb {
struct HexMap;
}
}  // namespace storage
}  // namespace shardok
}  // namespace eagle0
}  // namespace net

namespace shardok {

// Forward declarations
class ShardokAIClient;

namespace ai_testing_common {

/**
 * Factory class for creating ShardokAIClient instances with standard configuration.
 *
 * This centralizes the AI client creation logic that was duplicated
 * between AI Performance Runner and AI Battle Simulator.
 */
class AIClientFactory {
public:
    /**
     * Create an AI client for a player.
     *
     * @param playerId The player ID for this AI
     * @param isDefender True if this AI is the defender
     * @param hexMap The game's hex map
     * @param settings The game settings to use
     * @param algorithmType The AI algorithm to use (MCTS or ITERATIVE_DEEPENING)
     * @param scoringType The scoring calculator type (defaults to STANDARD)
     * @return Unique pointer to created ShardokAIClient
     */
    static auto Create(
            PlayerId playerId,
            bool isDefender,
            const net::eagle0::shardok::storage::fb::HexMap* hexMap,
            const SettingsGetter& settings,
            AIAlgorithmType algorithmType = AIAlgorithmType::ITERATIVE_DEEPENING,
            ScoringCalculatorType scoringType = ScoringCalculatorType::STANDARD)
            -> std::unique_ptr<ShardokAIClient>;
};

}  // namespace ai_testing_common
}  // namespace shardok

#endif  // EAGLE0_AI_CLIENT_FACTORY_HPP
