1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 11:47:34 +00:00

2048: Abstract Board into its own struct

This commit is contained in:
Dmitrii Ubskii 2021-06-11 15:26:56 +03:00 committed by Andreas Kling
parent ec8fe6952f
commit 11158c2400
3 changed files with 56 additions and 46 deletions

View file

@ -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; }