ELEC2645 (2018/19) / Mbed 2 deprecated el17ajf

Dependencies:   mbed

Fork of el17ajf by Angus Findlay

Grid/Grid.h

Committer:
el17ajf
Date:
2019-04-03
Revision:
19:370d83a8dc33
Parent:
18:24ce897024d0
Child:
29:d59fbe128d1f

File content as of revision 19:370d83a8dc33:

#ifndef GRID_H
#define GRID_H

#include "Tetromino.h"

class Grid {
public:
    bool isSpaceForTetromino(Tetromino tetromino);
    int placeTetromino(Tetromino tetromino);
    void clear();
    void draw();
    Grid();
    const static int GRID_HEIGHT = 20;
    const static int GRID_WIDTH = 10;
    
private:
    int checkForLines();
    void moveDownIfNeeded();
    void shiftDownFrom(int row);
    bool grid[10][20];
    bool isSpaceForBlock(Block block);
};
#endif