1 /***********************************************************************
2  *
3  * Copyright (C) 2007-2008 Graeme Gott <graeme@gottcode.org>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  *
18  ***********************************************************************/
19 
20 #ifndef CELL_H
21 #define CELL_H
22 
23 class QDataStream;
24 
25 class Cell
26 {
27 public:
28 	Cell();
29 
leftWall()30 	bool leftWall() const
31 		{ return m_left_wall; }
rightWall()32 	bool rightWall() const
33 		{ return m_right_wall; }
topWall()34 	bool topWall() const
35 		{ return m_top_wall; }
bottomWall()36 	bool bottomWall() const
37 		{ return m_bottom_wall; }
removeLeftWall()38 	void removeLeftWall()
39 		{ m_left_wall = false; }
removeRightWall()40 	void removeRightWall()
41 		{ m_right_wall = false; }
removeTopWall()42 	void removeTopWall()
43 		{ m_top_wall = false; }
removeBottomWall()44 	void removeBottomWall()
45 		{ m_bottom_wall = false; }
46 
pathMarker()47 	int pathMarker() const
48 		{ return m_path_marker * 90; }
49 	void setPathMarker(int angle);
50 
flag()51 	bool flag() const
52 		{ return m_flag; }
toggleFlag()53 	void toggleFlag()
54 		{ m_flag = !m_flag; }
55 
56     friend QDataStream& operator<<(QDataStream&, const Cell&);
57     friend QDataStream& operator>>(QDataStream&, Cell&);
58 
59 private:
60 	bool m_left_wall;
61 	bool m_right_wall;
62 	bool m_top_wall;
63 	bool m_bottom_wall;
64 	bool m_flag;
65 	unsigned char m_path_marker;
66 };
67 
68 #endif // CELL_H
69