#include <common.h>
Public Member Functions | |
| Point (int x=0, int y=0) | |
| Constructor. | |
| Point | operator+ (const Point &p) |
| Add two points together. | |
| void | invert () |
| Reverse the signs on the coordinates. | |
| void | setX (int x) |
| Set the x-coordinate in this point. | |
| void | setY (int y) |
| Set the y-coordinate in this point. | |
| int | x () const |
| Get a coordinate in this point. | |
| int | y () const |
| Get a coordinate in this point. | |
Private Attributes | |
| int | m_X |
| int | m_Y |
Since many functions in the player require a coordinate or two, this class simplifies passing two different parameters as one, unified class object
| Point::Point | ( | int | x = 0, |
|
| int | y = 0 | |||
| ) | [inline] |
Constructor.
| x | The x-coordinate | |
| y | The y-coordinate |
Add two points together.
| p | The second point to add |
| void Point::setX | ( | int | x | ) | [inline] |
Set the x-coordinate in this point.
| x | The coordinate |
| void Point::setY | ( | int | y | ) | [inline] |
Set the y-coordinate in this point.
| y | The coordinate |
1.5.3