1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 21:37:35 +00:00

2048: Animate sliding tiles

This commit is contained in:
Dmitrii Ubskii 2021-06-11 22:50:54 +03:00 committed by Andreas Kling
parent 8a8c2572b1
commit 242742b6c2
4 changed files with 77 additions and 15 deletions

View file

@ -67,6 +67,17 @@ public:
};
SlideResult slide_tiles(Direction);
struct SlidingTile {
size_t row_from;
size_t column_from;
u32 value_from;
size_t row_to;
size_t column_to;
u32 value_to;
};
Vector<SlidingTile> const& sliding_tiles() const { return m_sliding_tiles; }
private:
void reverse();
void transpose();
@ -79,6 +90,7 @@ public:
Tiles m_tiles;
Position m_last_added_position { 0, 0 };
Vector<SlidingTile> m_sliding_tiles;
};
Board const& board() const { return m_board; }