Public Member Functions | Public Attributes | Static Public Attributes | List of all members
nom::Coords Class Reference

Coordinate values (x, y, z, width, height ) wrapper. More...

#include <Coords.hpp>

Collaboration diagram for nom::Coords:
[legend]

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.
 

Detailed Description

Coordinate values (x, y, z, width, height ) wrapper.

Deprecated:
This class is likely to be phased out & replaced by nom::Point2, nom::Point3 and nom::Rect at some point in the near future!

Definition at line 44 of file Coords.hpp.

Member Function Documentation

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.

Here is the caller graph for this function:

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.

Here is the call graph for this function:

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

Todo:
Fully implement me

Definition at line 116 of file Coords.cpp.


The documentation for this class was generated from the following files: