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@29:d59fbe128d1f, 2019-04-13 (annotated)
- Committer:
- el17ajf
- Date:
- Sat Apr 13 08:33:49 2019 +0000
- Revision:
- 29:d59fbe128d1f
- Parent:
- 19:370d83a8dc33
- Child:
- 36:c854f1f51f43
fixed hidden height zone
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el17ajf | 18:24ce897024d0 | 1 | #ifndef GRID_H |
el17ajf | 18:24ce897024d0 | 2 | #define GRID_H |
el17ajf | 18:24ce897024d0 | 3 | |
el17ajf | 4:aa433f9865a6 | 4 | #include "Tetromino.h" |
el17ajf | 3:a1b058ff66c2 | 5 | |
el17ajf | 3:a1b058ff66c2 | 6 | class Grid { |
el17ajf | 3:a1b058ff66c2 | 7 | public: |
el17ajf | 3:a1b058ff66c2 | 8 | bool isSpaceForTetromino(Tetromino tetromino); |
el17ajf | 19:370d83a8dc33 | 9 | int placeTetromino(Tetromino tetromino); |
el17ajf | 4:aa433f9865a6 | 10 | void clear(); |
el17ajf | 4:aa433f9865a6 | 11 | void draw(); |
el17ajf | 8:5066ce13a430 | 12 | Grid(); |
el17ajf | 29:d59fbe128d1f | 13 | const static int HIDDEN_HEIGHT = 4; |
el17ajf | 29:d59fbe128d1f | 14 | const static int GRID_HEIGHT = 24; |
el17ajf | 15:afeefa3ceb61 | 15 | const static int GRID_WIDTH = 10; |
el17ajf | 7:2e37bad816cb | 16 | |
el17ajf | 3:a1b058ff66c2 | 17 | private: |
el17ajf | 19:370d83a8dc33 | 18 | int checkForLines(); |
el17ajf | 4:aa433f9865a6 | 19 | void moveDownIfNeeded(); |
el17ajf | 4:aa433f9865a6 | 20 | void shiftDownFrom(int row); |
el17ajf | 29:d59fbe128d1f | 21 | bool grid[GRID_WIDTH][GRID_HEIGHT]; |
el17ajf | 4:aa433f9865a6 | 22 | bool isSpaceForBlock(Block block); |
el17ajf | 18:24ce897024d0 | 23 | }; |
el17ajf | 18:24ce897024d0 | 24 | #endif |