1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:38:12 +00:00

Minesweeper: Create field from Difficulty enum

This change makes it easier to generate a new field. Instead of using
hard-coded values everywhere, we now just need to keep track of
the Difficulty enum value.
This commit is contained in:
Pedro Pereira 2021-11-14 11:53:56 +00:00 committed by Linus Groh
parent 1c29633110
commit 7b4b060b9c
4 changed files with 91 additions and 14 deletions

View file

@ -26,7 +26,7 @@ int CustomGameDialog::show(GUI::Window* parent_window, Field& field)
if (result != GUI::Dialog::ExecOK)
return result;
field.set_field_size(dialog->m_rows_spinbox->value(), dialog->m_columns_spinbox->value(), dialog->m_mines_spinbox->value());
field.set_field_size(Field::Difficulty::Custom, dialog->m_rows_spinbox->value(), dialog->m_columns_spinbox->value(), dialog->m_mines_spinbox->value());
return GUI::Dialog::ExecOK;
}