summaryrefslogtreecommitdiff
path: root/Userland/Games/Minesweeper/Field.h
AgeCommit message (Collapse)Author
2022-12-14Minesweeper: Make a factory function for Field and propagate errorsAndreas Kling
This fixes a pleasant 8 FIXMEs. :^)
2022-12-12Minesweeper: Use a faster method to generate game fieldArda Cinar
The existing method was simply using a "randomly generate until it fits our criteria" method to generate a game field. While this worked OK in most cases, the run time was increasing seriously in boards whose mine count / board size ratio was too big. The new approach simply generates every possible mine location, shuffles the array and picks its head. This uses more memory (shouldn't be a big deal since minesweeper boards are generally miniscule) but runs much quicker. The generation could still use some improvement (regarding error handling), though :^)
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-02-16Games: Use default constructors/destructorsLenny Maiorani
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
2021-11-15Minesweeper: Create field from Difficulty enumPedro Pereira
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.
2021-11-02Demos+DevTools+Games: Fix visibility of Object-derivative constructorsBen Wiederhake
Derivatives of Core::Object should be constructed through ClassName::construct(), to avoid handling ref-counted objects with refcount zero. Fixing the visibility means that misuses like this are more difficult.
2021-10-27Everywhere: Rename left/right-click to primary/secondaryFiliph Sandström
This resolves #10641.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-13Minesweeper: Use one premade mine palette for all mine widgetsJean-Baptiste Boric
Fixes #6283
2021-01-12Games: Move to Userland/Games/Andreas Kling