biquadris / cell.h
cell.h
Raw
/*
    Cell class module
    
    stores the internal data of each cell
	also has a pointer to a Block if it is filled with the Block
*/

#ifndef _CELL_H_
#define _CELL_H_

#include "subject.h"

class Block;
class Board;

class Cell : public Subject {
	int row, column, boardId;
	Block *theBlock;
	public:
		Cell(Board *b, int _row, int _col);

		// getType() gets the type of block filled in the cell
		// notes: returns ' ' if cell is not filled with block
		char getType();
		int getRow() const noexcept;
		int getCol() const noexcept;
		int getBoardId() const noexcept;
		Block *getBlock() const noexcept;
		void setCoords(int _row, int _col);
		void fillBlock(Block *b);
		void removeBlock();
};

#endif