package fr.monkhanny.dorfromantik.listeners;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import fr.monkhanny.dorfromantik.gui.GameModeSelectionPanel;

public class GameModePrevButtonActionListener implements ActionListener {
    private GameModeSelectionPanel panel;

    public GameModePrevButtonActionListener(GameModeSelectionPanel panel) {
        this.panel = panel;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if (panel.getCurrentPage() > 1) {
            panel.setCurrentPage(panel.getCurrentPage() - 1);
            panel.loadSeriesForCurrentPage();
        }
    }
}
