ELEC2645 (2018/19) / Mbed 2 deprecated el17ajf

Dependencies:   mbed

Fork of el17ajf by Angus Findlay

Grid/Grid.h

Committer:
el17ajf
Date:
2019-03-12
Revision:
4:aa433f9865a6
Parent:
3:a1b058ff66c2
Child:
5:3efbdcb3efaf

File content as of revision 4:aa433f9865a6:

#include "Tetromino.h"

class Grid {
public:
    bool isSpaceForTetromino(Tetromino tetromino);
    void placeTetromino(Tetromino tetromino);
    void clear();
    void draw();
private:
    void moveDownIfNeeded();
    void shiftDownFrom(int row);
    const int height = 20;
    const int width = 10;
    bool * grid = new bool[width][height];
    bool isSpaceForBlock(Block block);
};