
#ifndef BAT_H
#define BAT_H

#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "UX.h"

/** Bat Class
@author Shahid Zubin Sajid,
@brief Bat charactersitics and checks for collisions
@date May 2019
*/
class Bat
{

public:
    /**
    * @brief Constructor for the Bat Class
    */
    Bat();
    /**
    * @brief Deconstructor for the Bat Class
    */
    ~Bat();
     /**
    * @brief Initlialises the Bat class
    * @details Sets the Bat's position and sets the batting variables to 0
    */
    void init(int width,int height);
    /**
    * @brief Prints the bat to the LCD at the inititialised co-ordinates
    * @param &lcd @details reference object for a N5110 class object
    */
    void draw(N5110 &lcd);
     /**
    * @brief Resets the batting variables to 0
    * param &lcd @details reference pointer for the LCD
    */
    void reset();

    //accessors and mutators
      /**
    * @brief Checks if the ball has been hit with the bat during each round
    * @param @ux @details takes a UserExperience object to check if Button A has been pressed
    * @returns a boolean value true if ball has been hit during the round and false if ball was missed
    */
    int get_hit_ball(UX &ux);
       /**
    * @brief Checks if the hit was a lofted hit
    * @param @ux @details takes a UserExperience object to check if Button L has been pressed
    * @returns a boolean value true if button L is pressed during the round and false if button L is not pressed
    */
    int get_loft_ball(UX &ux);


private:

    /*integer variable used to check if ball is Hit, the variable is essentially used as a flag
     in the cricket method*/
    int _hit_ball;

    /*integer variable used to check if the hit is lofted, the variable is essentially used as a flag
    in the cricket class */
    int _loft_ball;

    //Direction of the ball
    int d;

    //x co-ordinate for the bat to be printed on the LCD
    int _bat_width;
    //y co-ordinate for the bat to be printed on the LCD
    int _bat_height;
};
#endif
