Improved format specifiers, bracing, removed C-style casts, whitespace fixes and removed Tiles shadowing

This commit is contained in:
Avamander
2021-12-05 22:22:06 +02:00
committed by JF
parent 645f6f43dc
commit 6a442b90a1
6 changed files with 46 additions and 33 deletions

View File

@@ -5,7 +5,7 @@
namespace Pinetime {
namespace Applications {
struct Tile {
struct TwosTile {
bool merged = false;
unsigned int value = 0;
};
@@ -26,11 +26,11 @@ namespace Pinetime {
lv_obj_t* scoreText;
lv_obj_t* gridDisplay;
Tile grid[4][4];
TwosTile grid[4][4];
unsigned int score = 0;
void updateGridDisplay(Tile grid[][4]);
bool tryMerge(Tile grid[][4], int& newRow, int& newCol, int oldRow, int oldCol);
bool tryMove(Tile grid[][4], int newRow, int newCol, int oldRow, int oldCol);
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);
bool placeNewTile();
};
}