#include <TileLocation.h>
Public Methods | |
TileLocation () | |
The default ctor creates a location at 0,0. | |
TileLocation (const TileLocation &o) | |
Copy constructor works as expected. | |
TileLocation (int x, int y) | |
Constructor for specifing initial location. | |
~TileLocation () | |
Destructor. | |
int | getX () const |
Returns the X location. | |
int | getY () const |
Returns the Y location. | |
void | north () |
Moves the TileLocation one tile "north" (as defined by the "screen"). | |
void | northeast () |
Moves the TileLocation one tile "northeast" (as defined by the "screen"). | |
void | east () |
Moves the TileLocation one tile "east" (as defined by the "screen"). | |
void | southeast () |
Moves the TileLocation one tile "southeast" (as defined by the "screen"). | |
void | south () |
Moves the TileLocation one tile "south" (as defined by the "screen"). | |
void | southwest () |
Moves the TileLocation one tile "southwest" (as defined by the "screen"). | |
void | west () |
Moves the TileLocation one tile "west" (as defined by the "screen"). | |
void | northwest () |
Moves the TileLocation one tile "northwest" (as defined by the "screen"). | |
TileLocation & | operator= (const TileLocation &rhs) |
Assignment operator works as expected. | |
bool | operator== (const TileLocation &rhs) |
Equality operator works as expected. |
TileLocations can be copied.
The TileLocation class is implemented in the header as its implementation is trivial from both a programmer and computational perspective. It is also used in the map's render loop and thus TileLocation makes a good canidate for inlining.
|
The default ctor creates a location at 0,0.
|
|
Copy constructor works as expected.
|
|
Constructor for specifing initial location.
|
|
Destructor.
|
|
Moves the TileLocation one tile "east" (as defined by the "screen").
|
|
Returns the X location.
|
|
Returns the Y location.
|
|
Moves the TileLocation one tile "north" (as defined by the "screen").
|
|
Moves the TileLocation one tile "northeast" (as defined by the "screen").
|
|
Moves the TileLocation one tile "northwest" (as defined by the "screen").
|
|
Assignment operator works as expected.
|
|
Equality operator works as expected.
|
|
Moves the TileLocation one tile "south" (as defined by the "screen").
|
|
Moves the TileLocation one tile "southeast" (as defined by the "screen").
|
|
Moves the TileLocation one tile "southwest" (as defined by the "screen").
|
|
Moves the TileLocation one tile "west" (as defined by the "screen").
|