package eu.midnightdust.yaytris.ui;

import javax.swing.*;

public class MainMenu extends AbstractMenu {
    final TetrisUI ui;

    MainMenu(int x, int y, int width, int height, TetrisUI ui) {
        this.ui = ui;
        this.setBounds(x, y, width, height);
        this.setLayout(null);

        JButton startButton = new JButton("Start");
        startButton.addActionListener(ui::startGame);
        this.add(startButton);

        JButton settingsButton = new JButton("Einstellungen");
        settingsButton.addActionListener(ui::openSettings);
        this.add(settingsButton);

        JButton leaveButton = new JButton("Spiel verlassen");
        leaveButton.addActionListener(e -> System.exit(0));
        this.add(leaveButton);
    }
}
