add multidoku to solo
Some checks failed
Linux arm64 / Build (push) Has been cancelled

This commit is contained in:
2025-01-28 09:56:44 +01:00
parent 0174ec08d7
commit b1ae79a2e8
2 changed files with 56 additions and 97 deletions

View File

@@ -2,12 +2,13 @@ package gui.menu;
import imgui.ImGui;
import imgui.type.ImInt;
import sudoku.structure.SudokuFactory;
public class SoloMenu extends BaseView {
private final ImInt sudokuType = new ImInt(0);
private static final String[] sudokuTypes = { "Carré", "Rectangle" };
private static final int SQUARE = 0, RECTANGLE = 1;
private static final String[] sudokuTypes = { "Carré", "Rectangle", "Multidoku" };
private static final int SQUARE = 0, RECTANGLE = 1, MULTIDOKU = 2;
private final ImInt sudokuSize = new ImInt(3);
@@ -26,7 +27,8 @@ public class SoloMenu extends BaseView {
case SQUARE:
ImGui.inputInt("Taille", sudokuSize);
if (ImGui.button("Résoudre un sudoku")) {
this.stateMachine.pushState(new SudokuView(stateMachine, sudokuSize.get(), sudokuSize.get()));
this.stateMachine.pushState(new SudokuView(stateMachine,
SudokuFactory.createBasicEmptySquareSudoku(sudokuSize.get())));
}
break;
@@ -34,10 +36,18 @@ public class SoloMenu extends BaseView {
ImGui.inputInt("Largeur", sudokuHeight);
ImGui.inputInt("Longueur", sudokuWidth);
if (ImGui.button("Résoudre un sudoku")) {
this.stateMachine.pushState(new SudokuView(stateMachine, sudokuWidth.get(), sudokuHeight.get()));
this.stateMachine.pushState(new SudokuView(stateMachine,
SudokuFactory.createBasicEmptyRectangleSudoku(sudokuWidth.get(), sudokuHeight.get())));
}
break;
case MULTIDOKU:
ImGui.inputInt("Taille", sudokuSize);
if (ImGui.button("Résoudre un multidoku")) {
this.stateMachine.pushState(new SudokuView(stateMachine,
SudokuFactory.createBasicSquareMultidoku(sudokuSize.get())));
}
default:
break;
}