import CasinoRoundsMode from '../models/GameModes/CasinoRoundsMode';
import TransCasinoRoundsMode from '../models/GameModes/TransCasinoRoundsMode';
import { isTransactionalFreeRounds } from './freeRounds';

import type BaseGameData from '../models/BaseGameData';
import type { ModeBetConfig } from '../models/GameModes/Mode';
import type Lines from '../models/Lines';
import type { LinesConfig } from '../models/Lines';

/**
 * Factory that selects the proper casino rounds mode implementation.
 * @param betConfig
 * @param gameData
 * @param lines
 */
export function createCasinoRoundsMode(
    betConfig: ModeBetConfig,
    gameData: BaseGameData,
    lines: Lines | LinesConfig,
): CasinoRoundsMode
{
    return isTransactionalFreeRounds()
        ? new TransCasinoRoundsMode(betConfig, gameData, lines)
        : new CasinoRoundsMode(betConfig, gameData, lines);
}
