1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 03:58:12 +00:00
serenity/Userland/Games/Snake/Skins/ClassicSkin.h
Sam Atkins 5708a47157 Snake: Implement image-based skins
Co-authored-by: HawDevelopment <hawdevelopment@gmail.com>
2023-03-20 09:29:30 +01:00

32 lines
885 B
C++

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2021, Mustafa Quraish <mustafa@serenityos.org>
* Copyright (c) 2023, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include "SnakeSkin.h"
#include <LibGfx/Color.h>
namespace Snake {
class ClassicSkin : public SnakeSkin {
public:
ClassicSkin(Color);
virtual ~ClassicSkin() override = default;
void draw_head(Gfx::Painter&, Gfx::IntRect const& head, Direction body_direction) override;
void draw_body(Gfx::Painter&, Gfx::IntRect const& rect, Direction previous_direction, Direction next_direction) override;
void draw_tail(Gfx::Painter& painter, Gfx::IntRect const& tail, Direction body_direction) override;
private:
void draw_tile_at(Gfx::Painter&, Gfx::IntRect const&);
Gfx::Color m_skin_color = { Color::Yellow };
};
}