testing documentation

Dependencies:   mbed ll16j23s_test_docs

Files at this revision

API Documentation at this revision

Comitter:
JoeShotton
Date:
Tue May 26 23:57:47 2020 +0000
Parent:
11:71794669fa48
Commit message:
documentation test 3

Changed in this revision

Food/Food.h Show annotated file Show diff for this revision Revisions of this file
SnakeBody/SnakeBody.h Show annotated file Show diff for this revision Revisions of this file
diff -r 71794669fa48 -r 33a5cff31339 Food/Food.h
--- a/Food/Food.h	Tue May 26 23:29:22 2020 +0000
+++ b/Food/Food.h	Tue May 26 23:57:47 2020 +0000
@@ -13,8 +13,6 @@
 @version V1.0
 */ 
 
-
-
 class Food
 {
     
@@ -23,9 +21,32 @@
     Food();
     ~Food();
     
+    
+    /** Initialises magnetometer and seeds random function
+    *@param Gamepad
+    *@param LCD
+    *@param Magnetometer
+    */
     void init(Gamepad &pad, N5110 &lcd, FXOS8700CQ &mag);
+    
+    
+    /** Chooses random coordinates for food
+    *@param Gamepad
+    *@param LCD
+    *@returns returns true if selected position is already on (ie the snake or walls are at this coordinate)
+    */
     bool rand_pos(Gamepad &pad, N5110 &lcd);
-    void draw(N5110 &lcd, int &_frame);
+    
+    
+    /** Animates food
+    *@param LCD
+    */
+    void draw(N5110 &lcd);
+    
+    
+    /** Runs food functions that need looping
+    *@param LCD
+    */
     void run(N5110 &lcd);
     
     int _x;
diff -r 71794669fa48 -r 33a5cff31339 SnakeBody/SnakeBody.h
--- a/SnakeBody/SnakeBody.h	Tue May 26 23:29:22 2020 +0000
+++ b/SnakeBody/SnakeBody.h	Tue May 26 23:57:47 2020 +0000
@@ -17,18 +17,38 @@
 class SnakeBody
 {
 struct Direction {
-     int delta_x; // increment value for x
-     int delta_y; // increment value for y
-     int nextState[5];  // array of next states
+     int delta_x; // increment value for x          /**< x incrementation of the body in this state  */
+     int delta_y; // increment value for y          /**< y incrementation of the body in this state  */
+     int nextState[5];  // array of next states     /**< array of next states  */
     };
 
 public:
 
     SnakeBody();
     ~SnakeBody();
+    
+    
+     /** Initialises the body
+    */
     void init();
+    
+    
+     /** Adjusts the _length_increase variable so the snake's length gradually increases
+    *@param The body units that the snake will eventually grow to
+    */
     void add_length(int increase);
-    void run(Gamepad &pad, N5110 &lcd, bool &_death); //draw, movement, snake-snakecollision
+    
+    
+    /** Runs the appropriate functions for the body
+    *@param Gamepad
+    *@param LCD
+    *@param _death is the flag for if there is a collision (in this case snake-snake)
+    */
+    void run(Gamepad &pad, N5110 &lcd, bool &_death); 
+    
+    
+     /** Resets body variables so game can be replayed 
+    */
     void reset();
     
     int _x_head;
@@ -39,12 +59,37 @@
 
 private:
     
+    
+    /** Controls all movement functions
+    *@param Gamepad
+    */
     void snake_movement(Gamepad &pad);
+    
+    
+    /** Draws body
+    *@param LCD
+    */
     void draw_body(N5110 &lcd);
+    
+    /** Detects snake-snake collision
+    *@param Gamepad
+    *@param _death  is the flag for if there is a collision (in this case snake-snake)
+    */
     void snake_snake_collision(Gamepad &pad, bool &_death); 
     
+    
+    /** Updates direction of snake
+    */
     void update_direction(); 
+    
+    
+    /** Updates position of snake
+    */
     void update_position(); 
+    
+    
+    /** Updates body coordinates of whole snake
+    */
     void update_body();
     
     float _angle;