Skip to content

Commit

Permalink
Document Rect and Point constructor parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
MLXXXp committed Nov 16, 2018
1 parent 195d3e5 commit c87f512
Showing 1 changed file with 34 additions and 5 deletions.
39 changes: 34 additions & 5 deletions src/Arduboy2.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@
#define CLEAR_BUFFER true /**< Value to be passed to `display()` to clear the screen buffer. */


//=============================================
//========== Rect (rectangle) object ==========
//=============================================

/** \brief
* A rectangle object for collision functions.
*
Expand All @@ -96,6 +100,7 @@
* given width and height.
*
* \see Arduboy2Base::collide(Point, Rect) Arduboy2Base::collide(Rect, Rect)
* Point
*/
struct Rect
{
Expand All @@ -104,27 +109,51 @@ struct Rect
uint8_t width; /**< The width of the rectangle */
uint8_t height; /**< The height of the rectangle */

Rect() = default; /**< The default constructor */
/** \brief
* The default constructor
*/
Rect() = default;

Rect(int16_t x, int16_t y, uint8_t width, uint8_t height); /**< The fully initialising constructor */
/** \brief
* The fully initializing constructor
*
* \param x The X coordinate of the top left corner. Copied to variable `x`.
* \param y The Y coordinate of the top left corner. Copied to variable `y`.
* \param width The width of the rectangle. Copied to variable `width`.
* \param height The height of the rectangle. Copied to variable `height`.
*/
Rect(int16_t x, int16_t y, uint8_t width, uint8_t height);
};

//==================================
//========== Point object ==========
//==================================

/** \brief
* An object to define a single point for collision functions.
*
* \details
* The location of the point is given by X and Y coordinates.
*
* \see Arduboy2Base::collide(Point, Rect)
* \see Arduboy2Base::collide(Point, Rect) Rect
*/
struct Point
{
int16_t x; /**< The X coordinate of the point */
int16_t y; /**< The Y coordinate of the point */

Point() = default; /**< The default constructor */
/** \brief
* The default constructor
*/
Point() = default;

Point(int16_t x, int16_t y); /**< The fully initialising constructor */
/** \brief
* The fully initializing constructor
*
* \param x The X coordinate of the point. Copied to variable `x`.
* \param y The Y coordinate of the point. Copied to variable `y`.
*/
Point(int16_t x, int16_t y);
};

//==================================
Expand Down

0 comments on commit c87f512

Please sign in to comment.