This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user