#ifndef cgrid_h
#define cgrid_h

#include "ForwardDeclarations.h"

enum BLOCK_TYPE {	RED_BLOCK, BLUE_BLOCK, GREEN_BLOCK, ORANGE_BLOCK, PURPLE_BLOCK, EMPTY_BLOCK,
                        RED_EXPLODER, BLUE_EXPLODER, GREEN_EXPLODER, ORANGE_EXPLODER, PURPLE_EXPLODER, NULL_TYPE };

class cGrid
{
public:
    cGrid();

    void draw();
    
    const static int gridXSize_ = 7;
    const static int gridYSize_ = 12;
    
    class cBlock
    {
    public:
        static BLOCK_TYPE getRandomBlockType();		// returns a random type of block
        
        cBlock();
        
        cGrid* grid_;	// the grid this block is in
        
        int x_, y_; 	// coordinates in grid
        
        float size_; // for the purposes of drawing
        
        BLOCK_TYPE type_;
        
        bool canMove(int dx, int dy);
        bool move(int dx, int dy);
        
        void draw();
    };
    
    cBlock blocks_[gridXSize_][gridYSize_];
};

#endif