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@9:3a7776a29a11, 2019-03-15 (annotated)
- Committer:
- el17ajf
- Date:
- Fri Mar 15 20:30:01 2019 +0000
- Revision:
- 9:3a7776a29a11
- Parent:
- 8:5066ce13a430
- Child:
- 11:fba7d54fd36b
added more graphics methods
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 | 7:2e37bad816cb | 10 | |
el17ajf | 3:a1b058ff66c2 | 11 | private: |
el17ajf | 7:2e37bad816cb | 12 | void checkForLines(); |
el17ajf | 4:aa433f9865a6 | 13 | void moveDownIfNeeded(); |
el17ajf | 4:aa433f9865a6 | 14 | void shiftDownFrom(int row); |
el17ajf | 9:3a7776a29a11 | 15 | const static int GRID_HEIGHT = 20; |
el17ajf | 9:3a7776a29a11 | 16 | const static int GRID_WIDTH = 10; |
el17ajf | 9:3a7776a29a11 | 17 | bool grid[GRID_WIDTH][GRID_HEIGHT]; |
el17ajf | 4:aa433f9865a6 | 18 | bool isSpaceForBlock(Block block); |
el17ajf | 3:a1b058ff66c2 | 19 | }; |