summaryrefslogtreecommitdiff
path: root/src/Model/Grid.hpp
blob: 810cb9b828739d5606f1f0e4975329d9db97f403 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef	DEF_GRID
#define	DEF_GRID

/* Grid.h
 * Defines the class Grid
 * A grid contains a table of cells the game will be set on
 * Creators : krilius, manzerbredes
 * Date : 29/04/2015 */

#include <iostream>
#include <vector>

//#include "ModelConstants.hpp"
#include "Cell.hpp"
#include "./Elements/StringElement.hpp"

class Grid
{
	private:
		int m_size;
		std::vector<std::vector<Cell<StringElement>*> > m_table;

	public:
		Grid(int size);
		~Grid();
		void show();

		bool isEmpty(int i, int j);
		bool gridIsFull();
		int getNRows();
		int getNCols();
		std::vector<Cell<StringElement>* > swipeLine(std::vector<Cell<StringElement>* > line);
		void swipeRight();
		void setCell(int i, int j, Cell<StringElement> *cell);
		Cell<StringElement>* getCell(short i, short j);

};


#endif