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@5:3efbdcb3efaf, 2019-03-13 (annotated)
- Committer:
- el17ajf
- Date:
- Wed Mar 13 09:30:36 2019 +0000
- Revision:
- 5:3efbdcb3efaf
- Parent:
- 4:aa433f9865a6
- Child:
- 7:2e37bad816cb
Immutable grid class
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 | 3:a1b058ff66c2 | 9 | private: |
el17ajf | 4:aa433f9865a6 | 10 | void moveDownIfNeeded(); |
el17ajf | 4:aa433f9865a6 | 11 | void shiftDownFrom(int row); |
el17ajf | 5:3efbdcb3efaf | 12 | const int HEIGHT = 20; |
el17ajf | 5:3efbdcb3efaf | 13 | const int WIDTH = 10; |
el17ajf | 5:3efbdcb3efaf | 14 | bool * grid;// = new bool[width][height]; |
el17ajf | 4:aa433f9865a6 | 15 | bool isSpaceForBlock(Block block); |
el17ajf | 3:a1b058ff66c2 | 16 | }; |