Project Submission (late)

Dependencies:   mbed

Committer:
el17tc
Date:
Fri May 10 14:52:28 2019 +0000
Revision:
3:83e79d31930c
Parent:
0:72f372170a73
final commit, API is added.; I'm not sure if there is a specific statement of academic integrity wanted but- I declare that this work is 100% my own, I have not plagiarised any work or attempted to fabricate any part of it for extra marks.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
el17tc 0:72f372170a73 1 #ifndef DRAWER_H
el17tc 0:72f372170a73 2 #define DRAWER_H
el17tc 0:72f372170a73 3
el17tc 0:72f372170a73 4 #include "Player.h"
el17tc 0:72f372170a73 5 #include "N5110.h"
el17tc 3:83e79d31930c 6 /** Drawer Class
el17tc 3:83e79d31930c 7 * @brief A class responsible for searching the maze matrix relative to the player's location
el17tc 3:83e79d31930c 8 * @brief and drawing the correct graphics to the LCD accordingly.
el17tc 3:83e79d31930c 9 * @brief can draw cells up to a distance of 4 in front of the player
el17tc 3:83e79d31930c 10 * @brief (not including the cell they are currently standing in).
el17tc 3:83e79d31930c 11 *
el17tc 3:83e79d31930c 12 * @brief Version 1.0
el17tc 3:83e79d31930c 13 * @author Thomas Caine
el17tc 3:83e79d31930c 14 * @date May 2019
el17tc 3:83e79d31930c 15 */
el17tc 0:72f372170a73 16 class Drawer {
el17tc 0:72f372170a73 17
el17tc 0:72f372170a73 18 public:
el17tc 3:83e79d31930c 19 /** Create a Drawer object capable of printing to the lcd
el17tc 3:83e79d31930c 20 * @param player - pointer to a player object. Player's direction and position is needed
el17tc 3:83e79d31930c 21 * @param screenPtr - pointer to the LCD object. Important for the lcd object to be shared so it's a pointer.
el17tc 3:83e79d31930c 22 */
el17tc 0:72f372170a73 23 Drawer(Player* player, N5110* screenPtr);
el17tc 3:83e79d31930c 24
el17tc 3:83e79d31930c 25 /** Draw the first branch.
el17tc 3:83e79d31930c 26 *
el17tc 3:83e79d31930c 27 * This corresponds to the line of 3 cells in front of the player,
el17tc 3:83e79d31930c 28 * beginning from the cell immediately to their _left_.
el17tc 3:83e79d31930c 29 * @param location - vector representing the cell to begin branch search from
el17tc 3:83e79d31930c 30 */
el17tc 0:72f372170a73 31 void drawBranch1(Vector2Di loc);
el17tc 3:83e79d31930c 32 /** Draw the second branch.
el17tc 3:83e79d31930c 33 *
el17tc 3:83e79d31930c 34 * This corresponds to the line of 3 cells in front of the player,
el17tc 3:83e79d31930c 35 * beginning from the cell immediately to their _right_.
el17tc 3:83e79d31930c 36 * @param location - vector representing the cell to begin branch search from
el17tc 3:83e79d31930c 37 */
el17tc 0:72f372170a73 38 void drawBranch2(Vector2Di loc);
el17tc 3:83e79d31930c 39 /** Draw the third branch.
el17tc 3:83e79d31930c 40 *
el17tc 3:83e79d31930c 41 * This corresponds to the line of 3 cells in front of the player,
el17tc 3:83e79d31930c 42 * beginning from the cell forward one and left one.
el17tc 3:83e79d31930c 43 * @param location - vector representing the cell to begin branch search from
el17tc 3:83e79d31930c 44 */
el17tc 0:72f372170a73 45 void drawBranch3(Vector2Di loc);
el17tc 3:83e79d31930c 46 /** Draw the fourth branch.
el17tc 3:83e79d31930c 47 *
el17tc 3:83e79d31930c 48 * This corresponds to the line of 3 cells in front of the player,
el17tc 3:83e79d31930c 49 * beginning from the cell forward one and right one.
el17tc 3:83e79d31930c 50 * @param location - vector representing the cell to begin branch search from
el17tc 3:83e79d31930c 51 */
el17tc 0:72f372170a73 52 void drawBranch4(Vector2Di loc);
el17tc 3:83e79d31930c 53 /** Draw the fifth branch.
el17tc 3:83e79d31930c 54 *
el17tc 3:83e79d31930c 55 * This corresponds to the line of 3 cells in front of the player,
el17tc 3:83e79d31930c 56 * beginning from the cell forward two and left one.
el17tc 3:83e79d31930c 57 * @param location - vector representing the cell to begin branch search from
el17tc 3:83e79d31930c 58 */
el17tc 0:72f372170a73 59 void drawBranch5(Vector2Di loc);
el17tc 3:83e79d31930c 60 /** Draw the fifth branch.
el17tc 3:83e79d31930c 61 *
el17tc 3:83e79d31930c 62 * This corresponds to the line of 3 cells in front of the player,
el17tc 3:83e79d31930c 63 * beginning from the cell forward two and right one.
el17tc 3:83e79d31930c 64 */
el17tc 0:72f372170a73 65 void drawBranch6(Vector2Di loc);
el17tc 3:83e79d31930c 66 /**
el17tc 3:83e79d31930c 67 * @brief Draw the player's current view to the screen buffer.
el17tc 3:83e79d31930c 68 *
el17tc 3:83e79d31930c 69 * @details drawScreen() will walk the cells in front of the player, checking
el17tc 3:83e79d31930c 70 * @details which cells are empty or solid. When it finds an empty cell either in
el17tc 3:83e79d31930c 71 * @details front, to the left or to the right of the current cell, it will draw graphics
el17tc 3:83e79d31930c 72 * @details and/or call the drawBranch# functions accordingly.
el17tc 3:83e79d31930c 73 */
el17tc 0:72f372170a73 74 void drawScreen();
el17tc 0:72f372170a73 75
el17tc 3:83e79d31930c 76 // references to the player and lcd objects
el17tc 0:72f372170a73 77 Player* player;
el17tc 0:72f372170a73 78 N5110* lcd;
el17tc 0:72f372170a73 79
el17tc 0:72f372170a73 80
el17tc 0:72f372170a73 81
el17tc 0:72f372170a73 82 };
el17tc 0:72f372170a73 83
el17tc 0:72f372170a73 84 #endif // DRAWER_H