diff options
| author | Jean-François Milants <jf@codingfield.com> | 2022-09-11 14:59:49 +0200 |
|---|---|---|
| committer | Jean-François Milants <jf@codingfield.com> | 2022-09-11 14:59:49 +0200 |
| commit | ada2c09581d2d13acfa5ce9a97671c0ec17863f1 (patch) | |
| tree | 2f776adc59d0c63e403d2043cb8460e65d6c46fe /src/displayapp/screens/Twos.h | |
| parent | 18cff286c75f432095db4b188e0f9a8a9e2bd8e8 (diff) | |
| parent | c9a5c3fa5c930a5939d3114a6c6b48570d61ca24 (diff) | |
Merge branch 'develop' into infineat-external-resources
# Conflicts:
# src/displayapp/screens/Symbols.h
# src/displayapp/screens/settings/SettingWatchFace.cpp
# src/displayapp/screens/settings/SettingWatchFace.h
Diffstat (limited to 'src/displayapp/screens/Twos.h')
| -rw-r--r-- | src/displayapp/screens/Twos.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/displayapp/screens/Twos.h b/src/displayapp/screens/Twos.h index 5a0c4350..4a6ada0b 100644 --- a/src/displayapp/screens/Twos.h +++ b/src/displayapp/screens/Twos.h @@ -26,11 +26,14 @@ namespace Pinetime { 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(); }; } |
