contains my game for the embedded systems project 2645

Dependencies:   mbed FXOS8700CQQQ

Committer:
OmarAlebiary
Date:
Sat Apr 20 21:23:33 2019 +0000
Revision:
26:35714debc45f
added tests.cpp and tests.h

Who changed what in which revision?

UserRevisionLine numberNew contents of line
OmarAlebiary 26:35714debc45f 1 #ifndef TESTS_H
OmarAlebiary 26:35714debc45f 2 #define TESTS_H
OmarAlebiary 26:35714debc45f 3 #include "RocketRacer.h"
OmarAlebiary 26:35714debc45f 4 #include "Menus.h"
OmarAlebiary 26:35714debc45f 5
OmarAlebiary 26:35714debc45f 6
OmarAlebiary 26:35714debc45f 7 /** Menus class
OmarAlebiary 26:35714debc45f 8
OmarAlebiary 26:35714debc45f 9 @brief C++ class containing the tests for methods
OmarAlebiary 26:35714debc45f 10
OmarAlebiary 26:35714debc45f 11 @version 1.0
OmarAlebiary 26:35714debc45f 12
OmarAlebiary 26:35714debc45f 13 @author Omar Alebiary
OmarAlebiary 26:35714debc45f 14
OmarAlebiary 26:35714debc45f 15 @date April 2019
OmarAlebiary 26:35714debc45f 16
OmarAlebiary 26:35714debc45f 17 @code
OmarAlebiary 26:35714debc45f 18
OmarAlebiary 26:35714debc45f 19 #include "mbed.h"
OmarAlebiary 26:35714debc45f 20 #include "N5110.h"
OmarAlebiary 26:35714debc45f 21 #include "Gamepad.h"
OmarAlebiary 26:35714debc45f 22 #include "RocketRacer.h"
OmarAlebiary 26:35714debc45f 23
OmarAlebiary 26:35714debc45f 24 // objects
OmarAlebiary 26:35714debc45f 25 Gamepad pad;
OmarAlebiary 26:35714debc45f 26 RocketRacer rc;
OmarAlebiary 26:35714debc45f 27 Menus menus;
OmarAlebiary 26:35714debc45f 28 tests test;
OmarAlebiary 26:35714debc45f 29
OmarAlebiary 26:35714debc45f 30
OmarAlebiary 26:35714debc45f 31
OmarAlebiary 26:35714debc45f 32 int main(){
OmarAlebiary 26:35714debc45f 33
OmarAlebiary 26:35714debc45f 34
OmarAlebiary 26:35714debc45f 35 setup();
OmarAlebiary 26:35714debc45f 36 test.test_welcomeMenu(pad,lcd);
OmarAlebiary 26:35714debc45f 37 test.test_PlayMelody(pad);
OmarAlebiary 26:35714debc45f 38 test.test_drawMenu(lcd, pad);
OmarAlebiary 26:35714debc45f 39 test.test_credits_page(lcd,pad);
OmarAlebiary 26:35714debc45f 40 test.test_loading_menu(lcd);
OmarAlebiary 26:35714debc45f 41 test.test_InstructionsMenu(pad,lcd);
OmarAlebiary 26:35714debc45f 42 test.test_Game_Loop(pad,lcd);
OmarAlebiary 26:35714debc45f 43
OmarAlebiary 26:35714debc45f 44
OmarAlebiary 26:35714debc45f 45
OmarAlebiary 26:35714debc45f 46
OmarAlebiary 26:35714debc45f 47
OmarAlebiary 26:35714debc45f 48 }
OmarAlebiary 26:35714debc45f 49
OmarAlebiary 26:35714debc45f 50 @endcode
OmarAlebiary 26:35714debc45f 51 */
OmarAlebiary 26:35714debc45f 52
OmarAlebiary 26:35714debc45f 53
OmarAlebiary 26:35714debc45f 54 class tests{
OmarAlebiary 26:35714debc45f 55
OmarAlebiary 26:35714debc45f 56 public:
OmarAlebiary 26:35714debc45f 57
OmarAlebiary 26:35714debc45f 58 /**
OmarAlebiary 26:35714debc45f 59 * @brief method to test welcome menu
OmarAlebiary 26:35714debc45f 60 * @param pad @details calls the Gamepad object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 61 * @param lcd @details calls the lcd object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 62 */
OmarAlebiary 26:35714debc45f 63 void test_welcomeMenu(Gamepad &pad,N5110 &lcd);
OmarAlebiary 26:35714debc45f 64 /**
OmarAlebiary 26:35714debc45f 65 * @brief method to test tones played in the game
OmarAlebiary 26:35714debc45f 66 * @param pad @details calls the Gamepad object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 67 */
OmarAlebiary 26:35714debc45f 68 void test_PlayMelody(Gamepad &pad);
OmarAlebiary 26:35714debc45f 69 /**
OmarAlebiary 26:35714debc45f 70 * @brief method to test the draw main menu method
OmarAlebiary 26:35714debc45f 71 * @param pad @details calls the Gamepad object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 72 * @param lcd @details calls the lcd object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 73 */
OmarAlebiary 26:35714debc45f 74 void test_drawMenu(N5110 &lcd,Gamepad &pad);
OmarAlebiary 26:35714debc45f 75 /**
OmarAlebiary 26:35714debc45f 76 * @brief method to test the credits page on the menu
OmarAlebiary 26:35714debc45f 77 * @param pad @details calls the Gamepad object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 78 * @param lcd @details calls the lcd object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 79 */
OmarAlebiary 26:35714debc45f 80 void test_credits_page(N5110 &lcd,Gamepad &pad);
OmarAlebiary 26:35714debc45f 81 /**
OmarAlebiary 26:35714debc45f 82 * @brief method to test the loading page
OmarAlebiary 26:35714debc45f 83 * @param lcd @details calls the lcd object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 84 */
OmarAlebiary 26:35714debc45f 85 void test_loading_menu(N5110 &lcd);
OmarAlebiary 26:35714debc45f 86 /**
OmarAlebiary 26:35714debc45f 87 * @brief method to test the instructions page
OmarAlebiary 26:35714debc45f 88 * @param lcd @details calls the lcd object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 89 * @param pad @details calls the Gamepad object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 90 */
OmarAlebiary 26:35714debc45f 91 void test_InstructionsMenu(Gamepad &pad,N5110 &lcd);
OmarAlebiary 26:35714debc45f 92 /**
OmarAlebiary 26:35714debc45f 93 * @brief method to test the game loop which has all the game methods calls in it
OmarAlebiary 26:35714debc45f 94 * @param lcd @details calls the lcd object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 95 * @param pad @details calls the Gamepad object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 96 */
OmarAlebiary 26:35714debc45f 97 void test_Game_Loop(Gamepad &pad,N5110 &lcd);
OmarAlebiary 26:35714debc45f 98
OmarAlebiary 26:35714debc45f 99 };
OmarAlebiary 26:35714debc45f 100
OmarAlebiary 26:35714debc45f 101 #endif