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@7:2e37bad816cb, 2019-03-15 (annotated)
- Committer:
- el17ajf
- Date:
- Fri Mar 15 07:55:23 2019 +0000
- Revision:
- 7:2e37bad816cb
- Parent:
- 5:3efbdcb3efaf
- Child:
- 8:5066ce13a430
getters and setters for block
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 | 7:2e37bad816cb | 9 | |
el17ajf | 3:a1b058ff66c2 | 10 | private: |
el17ajf | 7:2e37bad816cb | 11 | void checkForLines(); |
el17ajf | 4:aa433f9865a6 | 12 | void moveDownIfNeeded(); |
el17ajf | 4:aa433f9865a6 | 13 | void shiftDownFrom(int row); |
el17ajf | 7:2e37bad816cb | 14 | static const int HEIGHT = 20; |
el17ajf | 7:2e37bad816cb | 15 | static const int WIDTH = 10; |
el17ajf | 7:2e37bad816cb | 16 | bool grid[WIDTH][HEIGHT]; |
el17ajf | 4:aa433f9865a6 | 17 | bool isSpaceForBlock(Block block); |
el17ajf | 3:a1b058ff66c2 | 18 | }; |