Class containing all the bitmaps for the 10 different mazes used throughout the game.
Revision 3:8547399e8c29, committed 2017-05-04
- Comitter:
- el15mh
- Date:
- Thu May 04 14:01:45 2017 +0000
- Parent:
- 2:834bd321a30d
- Commit message:
- Doxygen commenting added
Changed in this revision
Maze.cpp | Show annotated file Show diff for this revision Revisions of this file |
Maze.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Maze.cpp Wed May 03 21:13:38 2017 +0000 +++ b/Maze.cpp Thu May 04 14:01:45 2017 +0000 @@ -1,29 +1,32 @@ -/* - - @file Maze.cpp - - (c) Max Houghton 19.03.17 - Roller Maze Project, ELEC2645, Univeristy of Leeds - - */ - #include "Maze.h" +/** + * @details - constructor + */ Maze::Maze() { } +/** + * @details - constructor + */ Maze::~Maze() { } +/** + * @details - Initalise object with index value. + */ void Maze::init(int mazeIndex) { _mazeIndex = mazeIndex; } +/** + * @details - Maze is drawn on LCD screen. + */ void Maze::draw(N5110 &lcd) { /// EASY MAZES /// @@ -62,24 +65,9 @@ } } -void Maze::testMaze(N5110 &lcd) -{ - // maze index 0 - for (int i = 0; i < WIDTH; i++){ - lcd.setPixel(i, 0); - lcd.setPixel(i, HEIGHT - 1); - } - - for (int j = 0; j < HEIGHT; j++){ - lcd.setPixel(0, j); - lcd.setPixel(WIDTH - 1, j); - } - - for (int j = 40; j < HEIGHT; j++){ - lcd.clearPixel(83, j); - } -} - +/** + * @details - Creating lcd buffer for maze 0 + */ void Maze::mazeIndexZero(N5110 &lcd) { // easy maze 1 @@ -109,6 +97,9 @@ } } +/** + * @details - Creating lcd buffer for maze 1 + */ void Maze::mazeIndexOne(N5110 &lcd) { // easy maze 2 @@ -138,6 +129,9 @@ } } +/** + * @details - Creating lcd buffer for maze 2 + */ void Maze::mazeIndexTwo(N5110 &lcd) { // easy maze 3 @@ -169,6 +163,9 @@ } +/** + * @details - Creating lcd buffer for maze 3 + */ void Maze::mazeIndexThree(N5110 &lcd) { // medium maze 1 @@ -213,6 +210,9 @@ } } +/** + * @details - Creating lcd buffer for maze 4 + */ void Maze::mazeIndexFour(N5110 &lcd) { // medium maze 2 @@ -267,7 +267,9 @@ } - +/** + * @details - Creating lcd buffer for maze 5 + */ void Maze::mazeIndexFive(N5110 &lcd) { // medium maze 3 @@ -325,6 +327,9 @@ } +/** + * @details - Creating lcd buffer for maze 6 + */ void Maze::mazeIndexSix(N5110 &lcd) { // hard maze 1 @@ -404,6 +409,9 @@ } } +/** + * @details - Creating lcd buffer for maze 7 + */ void Maze::mazeIndexSeven(N5110 &lcd) { // hard maze 2 @@ -496,7 +504,9 @@ } - +/** + * @details - Creating lcd buffer for maze 8 + */ void Maze::mazeIndexEight(N5110 &lcd) { // hard maze 3 @@ -594,6 +604,9 @@ } +/** + * @details - Creating lcd buffer for maze 9 + */ void Maze::mazeIndexNine(N5110 &lcd) { // maze index 9 @@ -973,7 +986,6 @@ lcd.drawLine(x, 32, x, 44, FILL_BLACK); /// END OF EXTREME MAZE /// - }
--- a/Maze.h Wed May 03 21:13:38 2017 +0000 +++ b/Maze.h Thu May 04 14:01:45 2017 +0000 @@ -1,10 +1,7 @@ -/* - - @file Maze.h - - (c) Max Houghton 19.03.17 - Roller Maze Project, ELEC2645, Univeristy of Leeds - +/** Maze Class + @brief Class contains all the mazes in the form of many series of lines. + @author Max Houghton + @date March 19 2017 */ #ifndef MAZE_H @@ -18,33 +15,118 @@ public: - // constructor & destructor + /** + * @details - constructor + */ Maze(); + + /** + * @details - constructor + */ ~Maze(); - // initialisation method - // desired maze is selected here + /** Initialise the maze + * + * @details - maze object is initialised with specific maze index value + * @param - mazeIndex - int to select which maze shall be drawn. + */ void init(int mazeIndex); + + /** Draw + * + * @details - Maze is drawn on LCD screen. + * @param - lcd - N5110 Library used to draw lines and set pixels which make up maze. + */ void draw(N5110 &lcd); private: - void testMaze(N5110 &lcd); + /** Maze Zero + * + * @details - Adding lines and pixels to lcd buffer which make up first maze (index 0). This is easy maze 1. + * @param - lcd - N5110 Library used to draw lines and pixels. + * + */ + void mazeIndexZero(N5110 &lcd); - void mazeIndexZero(N5110 &lcd); + /** Maze One + * + * @details - Adding lines and pixels to lcd buffer which make up first maze (index 1). This is easy maze 2. + * @param - lcd - N5110 Library used to draw lines and pixels. + * + */ void mazeIndexOne(N5110 &lcd); + + + /** Maze Two + * + * @details - Adding lines and pixels to lcd buffer which make up first maze (index 2). This is easy maze 3. + * @param - lcd - N5110 Library used to draw lines and pixels. + * + */ void mazeIndexTwo(N5110 &lcd); + /** Maze Three + * + * @details - Adding lines and pixels to lcd buffer which make up first maze (index 3). This is medium maze 1. + * @param - lcd - N5110 Library used to draw lines and pixels. + * + */ void mazeIndexThree(N5110 &lcd); + + /** Maze Four. + * + * @details - Adding lines and pixels to lcd buffer which make up first maze (index 4). This is medium maze 2. + * @param - lcd - N5110 Library used to draw lines and pixels. + * + */ void mazeIndexFour(N5110 &lcd); + + /** Maze Five. + * + * @details - Adding lines and pixels to lcd buffer which make up first maze (index 5). This is medium maze 3. + * @param - lcd - N5110 Library used to draw lines and pixels. + * + */ void mazeIndexFive(N5110 &lcd); + + /** Maze Six. + * + * @details - Adding lines and pixels to lcd buffer which make up first maze (index 6). This is hard maze 1. + * @param - lcd - N5110 Library used to draw lines and pixels. + * + */ void mazeIndexSix(N5110 &lcd); + + /** Maze Seven. + * + * @details - Adding lines and pixels to lcd buffer which make up first maze (index 7). This is hard maze 2. + * @param - lcd - N5110 Library used to draw lines and pixels. + * + */ void mazeIndexSeven(N5110 &lcd); + + /** Maze Eight. + * + * @details - Adding lines and pixels to lcd buffer which make up first maze (index 8). This is hard maze 3. + * @param - lcd - N5110 Library used to draw lines and pixels. + * + */ void mazeIndexEight(N5110 &lcd); + /** Maze Nine. + * + * @details - Adding lines and pixels to lcd buffer which make up first maze (index 9). This is the extreme version maze. + * @param - lcd - N5110 Library used to draw lines and pixels. + * + */ void mazeIndexNine(N5110 &lcd); + /** + * @details - Index value which is used in draw() function to allow the desired maze to be drawn. + * @param - _mazeIndex - integer to specify desired maze. + */ int _mazeIndex; };