import BaseMachine from '../slotMachines/BaseMachine';
import BaseSystem from '../systems/BaseSystem';

export default class ResetWinningSymbolsSystem extends BaseSystem
{
    public state: string = 'stopped';

    static override requiredMaps: string[] = ['winningSymbols', 'symbols'];

    constructor(machine: BaseMachine)
    {
        super(machine);
    }

    override onEnter()
    {
        this.resetWinningSymbolsMap();
    }

    override onLeave()
    {
    // Do nothing
    }

    update(_dt: number): void
    {
    // Do nothing
    }

    private resetWinningSymbolsMap()
    {
        this.machine.maps.winningSymbols = new Array(this.machine.maps.symbols.length).fill(false);
    }
}
