diff options
Diffstat (limited to 'src/displayapp/screens/Twos.h')
| -rw-r--r-- | src/displayapp/screens/Twos.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/displayapp/screens/Twos.h b/src/displayapp/screens/Twos.h index 5a0c4350..da935724 100644 --- a/src/displayapp/screens/Twos.h +++ b/src/displayapp/screens/Twos.h @@ -18,19 +18,19 @@ namespace Pinetime { bool OnTouchEvent(TouchEvents event) override; private: - lv_style_t style_cell1; - lv_style_t style_cell2; - lv_style_t style_cell3; - lv_style_t style_cell4; - lv_style_t style_cell5; + static constexpr int nColors = 5; + lv_style_t cellStyles[nColors]; lv_obj_t* scoreText; lv_obj_t* gridDisplay; - TwosTile grid[4][4]; + static constexpr int nCols = 4; + static constexpr int nRows = 4; + static constexpr int nCells = nCols * nRows; + TwosTile grid[nRows][nCols]; unsigned int score = 0; - void updateGridDisplay(TwosTile grid[][4]); - bool tryMerge(TwosTile grid[][4], int& newRow, int& newCol, int oldRow, int oldCol); - bool tryMove(TwosTile grid[][4], int newRow, int newCol, int oldRow, int oldCol); + void updateGridDisplay(); + bool tryMerge(int newRow, int newCol, int oldRow, int oldCol); + bool tryMove(int newRow, int newCol, int oldRow, int oldCol); bool placeNewTile(); }; } |
