mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
Hearts: Migrate to CardGame
This commit is contained in:
parent
f9f25271b3
commit
c709dc154f
4 changed files with 8 additions and 6 deletions
|
@ -894,8 +894,8 @@ void Game::paint_event(GUI::PaintEvent& event)
|
|||
painter.add_clip_rect(frame_inner_rect());
|
||||
painter.add_clip_rect(event.rect());
|
||||
|
||||
static Gfx::Color s_background_color = palette().color(background_role());
|
||||
painter.clear_rect(frame_inner_rect(), s_background_color);
|
||||
Gfx::Color background_color = this->background_color();
|
||||
painter.clear_rect(frame_inner_rect(), background_color);
|
||||
|
||||
for (auto& player : m_players) {
|
||||
auto& font = painter.font().bold_variant();
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
* Copyright (c) 2020, Till Mayer <till.mayer@web.de>
|
||||
* Copyright (c) 2021, Gunnar Beutner <gbeutner@serenityos.org>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -10,14 +11,14 @@
|
|||
|
||||
#include "Player.h"
|
||||
#include <LibCards/Card.h>
|
||||
#include <LibCards/CardGame.h>
|
||||
#include <LibCore/Timer.h>
|
||||
#include <LibGUI/Frame.h>
|
||||
|
||||
using Cards::Card;
|
||||
|
||||
namespace Hearts {
|
||||
|
||||
class Game final : public GUI::Frame {
|
||||
class Game final : public Cards::CardGame {
|
||||
C_OBJECT(Game)
|
||||
public:
|
||||
static constexpr int width = 640;
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
@Hearts::Game {
|
||||
name: "game"
|
||||
fill_with_background_color: true
|
||||
background_color: "green"
|
||||
}
|
||||
|
||||
@GUI::Statusbar {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
* Copyright (c) 2020, Till Mayer <till.mayer@web.de>
|
||||
* Copyright (c) 2021, Gunnar Beutner <gbeutner@serenityos.org>
|
||||
* Copyright (c) 2021, Mustafa Quraish <mustafa@serenityos.org>
|
||||
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -31,7 +32,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
auto app = TRY(GUI::Application::try_create(arguments));
|
||||
auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-hearts"sv));
|
||||
|
||||
Config::pledge_domain("Hearts");
|
||||
Config::pledge_domains({ "Games", "Hearts" });
|
||||
Config::monitor_domain("Games");
|
||||
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix"));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue