mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:37:35 +00:00
GameOfLife: Add choosable patterns
This commit is contained in:
parent
b808815e57
commit
1965d60aeb
6 changed files with 309 additions and 7 deletions
26
Userland/Games/GameOfLife/Pattern.h
Normal file
26
Userland/Games/GameOfLife/Pattern.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Ryan Wilson <ryan@rdwilson.xyz>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Board.h"
|
||||
#include <AK/Vector.h>
|
||||
#include <LibGUI/Event.h>
|
||||
#include <LibGUI/Forward.h>
|
||||
|
||||
class Pattern {
|
||||
public:
|
||||
Pattern(Vector<String>);
|
||||
virtual ~Pattern();
|
||||
Vector<String> pattern() { return m_pattern; };
|
||||
GUI::Action* action() { return m_action; }
|
||||
void set_action(GUI::Action*);
|
||||
void rotate_clockwise();
|
||||
|
||||
private:
|
||||
RefPtr<GUI::Action> m_action;
|
||||
Vector<String> m_pattern;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue