package gui.menu;

import gui.widget.SudokuSelector;
import imgui.ImGui;
import sudoku.structure.MultiDoku;

public class SoloMenu extends BaseView {

	private final SudokuSelector sudokuSelector;

	public SoloMenu(StateMachine stateMachine) {
		super(stateMachine);
		this.sudokuSelector = new SudokuSelector(true, "Résoudre le sudoku");
		this.sudokuSelector.onSelect.connect(this::pushSudokuState);
	}

	private void pushSudokuState(MultiDoku doku) {
		this.stateMachine.pushState(new SudokuView(stateMachine, doku));
	}

	@Override
	public void render() {
		ImGui.text("Solo");
		sudokuSelector.render();
		renderReturnButton();
	}

}
