mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 15:07:44 +00:00
2048: Abstract Board into its own struct
This commit is contained in:
parent
ec8fe6952f
commit
11158c2400
3 changed files with 56 additions and 46 deletions
|
@ -35,7 +35,17 @@ public:
|
|||
u32 target_tile() const { return m_target_tile; }
|
||||
u32 largest_tile() const;
|
||||
|
||||
using Board = Vector<Vector<u32>>;
|
||||
struct Board {
|
||||
using Row = Vector<u32>;
|
||||
using Tiles = Vector<Row>;
|
||||
|
||||
Tiles tiles;
|
||||
|
||||
void add_tile(size_t row, size_t column, u32 value)
|
||||
{
|
||||
tiles[row][column] = value;
|
||||
}
|
||||
};
|
||||
|
||||
Board const& board() const { return m_board; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue