import { createCasinoRoundsMode } from '../../utils/createCasinoRoundsMode';
import FreeSpinsMode from '../GameModes/FreeSpinsMode';
import MainMode from '../GameModes/MainMode';
import RespinsMode from '../GameModes/RespinsMode';

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

export class ModesFactory
{
    createMain(bets: ModeBetConfig, gameData: BaseGameData, lines: Lines | LinesConfig)
    {
        return new MainMode(bets, gameData, lines);
    }

    createCasinoRounds(bets: ModeBetConfig, gameData: BaseGameData, lines: Lines | LinesConfig)
    {
        return createCasinoRoundsMode(bets, gameData, lines);
    }

    createBonus(bets: ModeBetConfig, gameData: BaseGameData, lines: Lines | LinesConfig)
    {
        return (gameData.isRespinsGameRestored || gameData.isRespinsGameFinished)
            ? new RespinsMode(bets, gameData, lines)
            : new FreeSpinsMode(bets, gameData, lines);
    }
}
