ELEC2645 (2017/18) / Mbed OS el16ajm
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Food.h Source File

Food.h

00001 #include "mbed.h"
00002 #include "N5110.h"
00003 #include "Gamepad.h"
00004 
00005 
00006 /** The Food class
00007 * @brief Stores the position of the food to be eaten and randomises its location
00008 * @author Andrew J. Moore
00009 * @date May, 2018
00010 */
00011 
00012 class Food
00013 {
00014 public:
00015 
00016     /** Constructor */
00017     Food();
00018     
00019     /** Destructor */
00020     ~Food();
00021 
00022     /** Initialisation function
00023     * @param the inital starting position for the food, given in X and Y (int)
00024     */
00025     void init(int x, int y);
00026 
00027     /** Gets the current X coordinate of the food
00028     * @return the current X coordinate
00029     */
00030     int getX();
00031     
00032     
00033     /** Gets the current Y coordinate of the food
00034     * @return the current Y coordinate
00035     */
00036     int getY();
00037     
00038     
00039     /** Randomises the current location of the food   */
00040     void random();
00041 
00042 private:
00043 
00044     //Private Variables
00045     int _x;
00046     int _y;
00047 };