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
Grid/Grid.h@15:afeefa3ceb61, 2019-03-19 (annotated)
- Committer:
- el17ajf
- Date:
- Tue Mar 19 10:36:51 2019 +0000
- Revision:
- 15:afeefa3ceb61
- Parent:
- 11:fba7d54fd36b
- Child:
- 18:24ce897024d0
added switch debouncing
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el17ajf | 4:aa433f9865a6 | 1 | #include "Tetromino.h" |
el17ajf | 3:a1b058ff66c2 | 2 | |
el17ajf | 3:a1b058ff66c2 | 3 | class Grid { |
el17ajf | 3:a1b058ff66c2 | 4 | public: |
el17ajf | 3:a1b058ff66c2 | 5 | bool isSpaceForTetromino(Tetromino tetromino); |
el17ajf | 3:a1b058ff66c2 | 6 | void placeTetromino(Tetromino tetromino); |
el17ajf | 4:aa433f9865a6 | 7 | void clear(); |
el17ajf | 4:aa433f9865a6 | 8 | void draw(); |
el17ajf | 8:5066ce13a430 | 9 | Grid(); |
el17ajf | 15:afeefa3ceb61 | 10 | const static int GRID_HEIGHT = 20; |
el17ajf | 15:afeefa3ceb61 | 11 | const static int GRID_WIDTH = 10; |
el17ajf | 7:2e37bad816cb | 12 | |
el17ajf | 3:a1b058ff66c2 | 13 | private: |
el17ajf | 7:2e37bad816cb | 14 | void checkForLines(); |
el17ajf | 4:aa433f9865a6 | 15 | void moveDownIfNeeded(); |
el17ajf | 4:aa433f9865a6 | 16 | void shiftDownFrom(int row); |
el17ajf | 11:fba7d54fd36b | 17 | bool grid[10][20]; |
el17ajf | 4:aa433f9865a6 | 18 | bool isSpaceForBlock(Block block); |
el17ajf | 3:a1b058ff66c2 | 19 | }; |