contains my game for the embedded systems project 2645

Dependencies:   mbed FXOS8700CQQQ

Committer:
OmarAlebiary
Date:
Thu Apr 25 10:44:53 2019 +0000
Revision:
29:e660274d8222
Parent:
28:39607fb67e88
Child:
33:24ef796ff2c8
added doxygen comments

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 28:39607fb67e88 5 #include "GameTones.h"
OmarAlebiary 26:35714debc45f 6
OmarAlebiary 26:35714debc45f 7
OmarAlebiary 26:35714debc45f 8 /** Menus class
OmarAlebiary 26:35714debc45f 9
OmarAlebiary 26:35714debc45f 10 @brief C++ class containing the tests for methods
OmarAlebiary 26:35714debc45f 11
OmarAlebiary 26:35714debc45f 12 @version 1.0
OmarAlebiary 26:35714debc45f 13
OmarAlebiary 26:35714debc45f 14 @author Omar Alebiary
OmarAlebiary 26:35714debc45f 15
OmarAlebiary 26:35714debc45f 16 @date April 2019
OmarAlebiary 26:35714debc45f 17
OmarAlebiary 26:35714debc45f 18 @code
OmarAlebiary 26:35714debc45f 19
OmarAlebiary 26:35714debc45f 20 #include "mbed.h"
OmarAlebiary 26:35714debc45f 21 #include "N5110.h"
OmarAlebiary 26:35714debc45f 22 #include "Gamepad.h"
OmarAlebiary 26:35714debc45f 23 #include "RocketRacer.h"
OmarAlebiary 26:35714debc45f 24
OmarAlebiary 26:35714debc45f 25 // objects
OmarAlebiary 26:35714debc45f 26 Gamepad pad;
OmarAlebiary 26:35714debc45f 27 RocketRacer rc;
OmarAlebiary 26:35714debc45f 28 Menus menus;
OmarAlebiary 26:35714debc45f 29 tests test;
OmarAlebiary 26:35714debc45f 30
OmarAlebiary 26:35714debc45f 31
OmarAlebiary 26:35714debc45f 32
OmarAlebiary 26:35714debc45f 33 int main(){
OmarAlebiary 26:35714debc45f 34
OmarAlebiary 26:35714debc45f 35
OmarAlebiary 26:35714debc45f 36 setup();
OmarAlebiary 26:35714debc45f 37 test.test_welcomeMenu(pad,lcd);
OmarAlebiary 28:39607fb67e88 38 test.test_Play_Welcome_Melody(pad);
OmarAlebiary 28:39607fb67e88 39 test.test_End_Game_Melody(Gamepad &pad);
OmarAlebiary 26:35714debc45f 40 test.test_drawMenu(lcd, pad);
OmarAlebiary 26:35714debc45f 41 test.test_credits_page(lcd,pad);
OmarAlebiary 26:35714debc45f 42 test.test_loading_menu(lcd);
OmarAlebiary 26:35714debc45f 43 test.test_InstructionsMenu(pad,lcd);
OmarAlebiary 26:35714debc45f 44 test.test_Game_Loop(pad,lcd);
OmarAlebiary 29:e660274d8222 45 test.test_Joystick_position(pad);
OmarAlebiary 29:e660274d8222 46 test.test_Generate_New_Enemy();
OmarAlebiary 26:35714debc45f 47
OmarAlebiary 26:35714debc45f 48
OmarAlebiary 26:35714debc45f 49
OmarAlebiary 26:35714debc45f 50
OmarAlebiary 26:35714debc45f 51
OmarAlebiary 26:35714debc45f 52 }
OmarAlebiary 26:35714debc45f 53
OmarAlebiary 26:35714debc45f 54 @endcode
OmarAlebiary 26:35714debc45f 55 */
OmarAlebiary 26:35714debc45f 56
OmarAlebiary 26:35714debc45f 57
OmarAlebiary 26:35714debc45f 58 class tests{
OmarAlebiary 26:35714debc45f 59
OmarAlebiary 26:35714debc45f 60 public:
OmarAlebiary 29:e660274d8222 61 /**
OmarAlebiary 29:e660274d8222 62 * @brief Default Constructor
OmarAlebiary 29:e660274d8222 63 * @details Creates the object of class tests
OmarAlebiary 29:e660274d8222 64 */
OmarAlebiary 28:39607fb67e88 65 tests();
OmarAlebiary 29:e660274d8222 66 /**
OmarAlebiary 29:e660274d8222 67 * @brief Default destructor
OmarAlebiary 29:e660274d8222 68 * @details destroys the object of class tests
OmarAlebiary 29:e660274d8222 69 */
OmarAlebiary 29:e660274d8222 70 ~tests();
OmarAlebiary 26:35714debc45f 71 /**
OmarAlebiary 26:35714debc45f 72 * @brief method to test welcome menu
OmarAlebiary 26:35714debc45f 73 * @param pad @details calls the Gamepad object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 74 * @param lcd @details calls the lcd object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 75 */
OmarAlebiary 26:35714debc45f 76 void test_welcomeMenu(Gamepad &pad,N5110 &lcd);
OmarAlebiary 26:35714debc45f 77 /**
OmarAlebiary 26:35714debc45f 78 * @brief method to test tones played in the game
OmarAlebiary 26:35714debc45f 79 * @param pad @details calls the Gamepad object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 80 */
OmarAlebiary 28:39607fb67e88 81 void test_Play_Welcome_Melody(Gamepad &pad);
OmarAlebiary 28:39607fb67e88 82 /**
OmarAlebiary 28:39607fb67e88 83 * @brief method to test tones played in the game over screen
OmarAlebiary 28:39607fb67e88 84 * @param pad @details calls the Gamepad object to be passed to the methods called inside this method
OmarAlebiary 28:39607fb67e88 85 */
OmarAlebiary 28:39607fb67e88 86 void test_End_Game_Melody(Gamepad &pad);
OmarAlebiary 26:35714debc45f 87 /**
OmarAlebiary 26:35714debc45f 88 * @brief method to test the draw main menu 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 * @param lcd @details calls the lcd object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 91 */
OmarAlebiary 26:35714debc45f 92 void test_drawMenu(N5110 &lcd,Gamepad &pad);
OmarAlebiary 26:35714debc45f 93 /**
OmarAlebiary 26:35714debc45f 94 * @brief method to test the credits page on the menu
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 * @param lcd @details calls the lcd object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 97 */
OmarAlebiary 26:35714debc45f 98 void test_credits_page(N5110 &lcd,Gamepad &pad);
OmarAlebiary 26:35714debc45f 99 /**
OmarAlebiary 26:35714debc45f 100 * @brief method to test the loading page
OmarAlebiary 26:35714debc45f 101 * @param lcd @details calls the lcd object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 102 */
OmarAlebiary 26:35714debc45f 103 void test_loading_menu(N5110 &lcd);
OmarAlebiary 26:35714debc45f 104 /**
OmarAlebiary 26:35714debc45f 105 * @brief method to test the instructions page
OmarAlebiary 26:35714debc45f 106 * @param lcd @details calls the lcd object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 107 * @param pad @details calls the Gamepad object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 108 */
OmarAlebiary 26:35714debc45f 109 void test_InstructionsMenu(Gamepad &pad,N5110 &lcd);
OmarAlebiary 26:35714debc45f 110 /**
OmarAlebiary 26:35714debc45f 111 * @brief method to test the game loop which has all the game methods calls in it
OmarAlebiary 26:35714debc45f 112 * @param lcd @details calls the lcd object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 113 * @param pad @details calls the Gamepad object to be passed to the methods called inside this method
OmarAlebiary 26:35714debc45f 114 */
OmarAlebiary 26:35714debc45f 115 void test_Game_Loop(Gamepad &pad,N5110 &lcd);
OmarAlebiary 29:e660274d8222 116 /**
OmarAlebiary 29:e660274d8222 117 * @brief method to test the position of the joystick and prints its current state
OmarAlebiary 29:e660274d8222 118 * @param pad @details calls the Gamepad object to be passed to the methods called inside this method
OmarAlebiary 29:e660274d8222 119 */
OmarAlebiary 29:e660274d8222 120 bool test_Joystick_position(Gamepad &pad);
OmarAlebiary 29:e660274d8222 121 /**
OmarAlebiary 29:e660274d8222 122 * @brief method to test generated numbers
OmarAlebiary 29:e660274d8222 123 * @details it tests if the randomly genrated number is 1,2 or 3 and returns true otherwise false
OmarAlebiary 29:e660274d8222 124 */
OmarAlebiary 29:e660274d8222 125 bool test_Generate_New_Enemy();
OmarAlebiary 26:35714debc45f 126
OmarAlebiary 28:39607fb67e88 127 private:
OmarAlebiary 28:39607fb67e88 128 Menus menu;
OmarAlebiary 28:39607fb67e88 129 RocketRacer Rocket_Racing;
OmarAlebiary 28:39607fb67e88 130 GameTones Game_Tones;
OmarAlebiary 28:39607fb67e88 131
OmarAlebiary 26:35714debc45f 132 };
OmarAlebiary 26:35714debc45f 133
OmarAlebiary 26:35714debc45f 134 #endif