Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of el17ajf by
Diff: Grid/Grid.h
- Revision:
- 41:91b0c73b9e02
- Parent:
- 36:c854f1f51f43
diff -r 052819060e38 -r 91b0c73b9e02 Grid/Grid.h
--- a/Grid/Grid.h Tue Apr 30 09:19:13 2019 +0000
+++ b/Grid/Grid.h Thu May 09 12:10:29 2019 +0000
@@ -55,10 +55,36 @@
const static int GRID_WIDTH = 10;
private:
+ /**
+ * @brief Checks for full rows and moves the blocks down if required,
+ * "clearing" rows on the grid.
+ * @returns The number of lines that have been cleared
+ */
int checkForLines();
+
+ /**
+ * @brief checks all rows and shifts them down if required
+ */
void moveDownIfNeeded();
+
+ /**
+ * @brief Moves the rows from row to row + 1, 'shifting' them down.
+ * @param row The row to start shifting down from. All rows below this
+ * will be translated down.
+ */
void shiftDownFrom(int row);
+
+ /**
+ * The grid as an array of booleans, true where there's a block
+ * in the space, false if it's empty
+ */
bool grid[GRID_WIDTH][GRID_HEIGHT];
+
+ /**
+ * @brief Checks if a block fits on the grid.
+ * @param block The block to check
+ * @returns True if the given block can fit in the grid, else false
+ */
bool isSpaceForBlock(Block block);
};
#endif
\ No newline at end of file
