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@8:5066ce13a430, 2019-03-15 (annotated)
- Committer:
- el17ajf
- Date:
- Fri Mar 15 16:39:06 2019 +0000
- Revision:
- 8:5066ce13a430
- Parent:
- 7:2e37bad816cb
- Child:
- 9:3a7776a29a11
added some 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 | 8:5066ce13a430 | 15 | const static int HEIGHT = 20; |
el17ajf | 8:5066ce13a430 | 16 | const static int WIDTH = 10; |
el17ajf | 7:2e37bad816cb | 17 | bool grid[WIDTH][HEIGHT]; |
el17ajf | 4:aa433f9865a6 | 18 | bool isSpaceForBlock(Block block); |
el17ajf | 3:a1b058ff66c2 | 19 | }; |