mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:27:35 +00:00
Snake: Make a factory function for SnakeGame and propagate errors
This fixes a whopping 29 FIXMEs. :^)
This commit is contained in:
parent
781e3aea8b
commit
ddb22cf10d
3 changed files with 42 additions and 33 deletions
|
@ -15,12 +15,14 @@ class SnakeGame : public GUI::Frame {
|
|||
C_OBJECT(SnakeGame);
|
||||
|
||||
public:
|
||||
static ErrorOr<NonnullRefPtr<SnakeGame>> create();
|
||||
virtual ~SnakeGame() override = default;
|
||||
|
||||
void reset();
|
||||
|
||||
private:
|
||||
SnakeGame();
|
||||
explicit SnakeGame(NonnullRefPtrVector<Gfx::Bitmap> food_bitmaps);
|
||||
|
||||
virtual void paint_event(GUI::PaintEvent&) override;
|
||||
virtual void keydown_event(GUI::KeyEvent&) override;
|
||||
virtual void timer_event(Core::TimerEvent&) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue