- nom
- Coords
Coordinate values (x, y, z, width, height ) wrapper. More...
#include <Coords.hpp>
Public Member Functions | |
| Coords (void) | |
| Default constructor; sets all values to their respective defaults. | |
| ~Coords (void) | |
| Destructor. | |
| Coords (const Coords &coords) | |
| Copy constructor. | |
| Coords (int32 x, int32 y, int32 width, int32 height) | |
| Constructor variant for creating coords. | |
| Coords (int32 x, int32 y) | |
| Constructor variant for creating coords. | |
| bool | isNull (void) const |
| const Coords & | get (void) const |
| Convenience getter for obtaining a copy of this object. | |
| Coords | getPosition (void) const |
| void | setPosition (int32 x, int32 y) |
| Coords | getSize (void) const |
| void | setSize (int32 width, int32 height) |
| bool | contains (int32 x, int32 y) const |
| bool | contains (const Coords &pos) const |
| bool | intersects (Coords &rectangle) const |
| Checks to see if our rectangle overlaps with another. | |
| Coords & | operator= (const Coords &other) |
| Copy assignment operator. | |
Public Attributes | |
| int32 | x |
| int32 | y |
| int32 | width |
| int32 | height |
| int32 & | w = width |
| Reference alias for width instance variable. | |
| int32 & | h = height |
| Reference alias for height instance variable. | |
Static Public Attributes | |
| static const Coords | null |
| Convenience object that will always contain a value of -1. | |
Coordinate values (x, y, z, width, height ) wrapper.
Definition at line 44 of file Coords.hpp.
| bool nom::Coords::contains | ( | int32 | x, |
| int32 | y | ||
| ) | const |
Check to see if input X, Y coordinates are within the bounds of this object – or in other words, a collision!
Definition at line 76 of file Coords.cpp.
| bool nom::Coords::contains | ( | const Coords & | pos | ) | const |
Check to see if input X, Y coordinates are within the bounds of this object – or in other words, a collision!
...
Definition at line 84 of file Coords.cpp.
| bool nom::Coords::isNull | ( | void | ) | const |
Convenience method for determining if this object is initialized or not; an initialized object should never be equal to nom::Coords::null
Definition at line 116 of file Coords.cpp.