1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:17:36 +00:00

Solitaire: Place files in Solitaire namespace and rename main widget

The purpose is to allow the Solitaire widget to be used in GML. The
macro to register a widget requires a namespace, so this moves all files
in the application to the Solitaire namespace. This also renames the
SolitaireWidget class to Game - this is to avoid the redundancy /
verbosity of typing "Solitaire::SolitaireWidget", and matches many other
games in Serenity (Breakout, 2048, etc.).
This commit is contained in:
Timothy Flynn 2021-05-05 09:42:59 -04:00 committed by Andreas Kling
parent 15f0ee1727
commit e1492e9a62
8 changed files with 59 additions and 35 deletions

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "SolitaireWidget.h"
#include "Game.h"
#include <LibGUI/Action.h>
#include <LibGUI/Application.h>
#include <LibGUI/Icon.h>
@ -37,9 +37,9 @@ int main(int argc, char** argv)
auto window = GUI::Window::construct();
window->set_resizable(false);
window->resize(SolitaireWidget::width, SolitaireWidget::height);
window->resize(Solitaire::Game::width, Solitaire::Game::height);
auto widget = SolitaireWidget::construct([&](uint32_t score) {
auto widget = Solitaire::Game::construct([&](uint32_t score) {
window->set_title(String::formatted("Score: {} - Solitaire", score));
});