Location Class Reference

#include <Location.h>

List of all members.

Public Member Functions

 Location (Uint32 x=0, Uint32 z=0, Uint32 y=0)
virtual ~Location ()
Uint32 getX ()
void setX (Uint32 newX)
Uint32 getY ()
void setY (Uint32 newY)
Uint32 getZ ()
void setZ (Uint32 newZ)
void setXYZ (Uint32 newX, Uint32 newY, Uint32 newZ)
void getXYZ (Uint32 &x, Uint32 &y, Uint32 &z)
Locationoperator= (const Location &l)
bool operator== (const Location &l)
bool operator!= (const Location &l)

Private Attributes

Uint32 mX
Uint32 mY
Uint32 mZ


Detailed Description

Represents a position in game.

Definition at line 9 of file Location.h.


Constructor & Destructor Documentation

Location::Location Uint32  x = 0,
Uint32  z = 0,
Uint32  y = 0
 

Creates a new Location, if no arguments are specified we create a 0,0,0 Location, wich is the invalid Location.

Definition at line 4 of file Location.cpp.

00005     :mX(x),
00006     mY(y),
00007     mZ(z)
00008 {
00009     //ctor
00010 }

Location::~Location  )  [virtual]
 

Virtual destructor.

Definition at line 12 of file Location.cpp.

00013 {
00014     //dtor
00015 }


Member Function Documentation

Uint32 Location::getX  )  [inline]
 

Returns the X coordinate.

Author:
stonedz
Since:
pre-alpha
Returns:
The X coordinate of the Location.

Definition at line 31 of file Location.h.

00031 {return mX;}

void Location::getXYZ Uint32 &  x,
Uint32 &  y,
Uint32 &  z
[inline]
 

Returns the 3 coordinates X Y and Z.

Author:
stonedz
Since:
pre-alpha
Parameters:
x Returned X coordinate.
y Returned Y coordinate.
z Returned Z coordinate.

Definition at line 100 of file Location.h.

00100                                                  {x = mX;
00101                                                   y = mY;
00102                                                   z = mZ;}

Uint32 Location::getY  )  [inline]
 

Returns the Y coordinate.0

Author:
stonedz
Since:
pre-alpha
Returns:
The Y coordinate of the Location.

Definition at line 49 of file Location.h.

00049 {return mY;}

Uint32 Location::getZ  )  [inline]
 

Returns the Z coordinate.

Author:
stonedz
Since:
pre-alpha
Returns:
The Z coordinate of the Location.

Definition at line 67 of file Location.h.

00067 {return mZ;}

Location & Location::operator= const Location l  ) 
 

Redefines the assignment operator.

Author:
stonedz
Since:
pre-alpha

Definition at line 17 of file Location.cpp.

References mX, mY, and mZ.

00017                                                {
00018         if (this == &l) // Handle self-assignment.
00019             return *this;
00020 
00021         //Deletes eventual dyamic allocated memory here.
00022 
00023         //Copy members.
00024         mX = l.mX;
00025         mY = l.mY;
00026         mZ = l.mZ;
00027 
00028         return *this;
00029 }

bool Location::operator== const Location l  ) 
 

Redefines the equality operator (==)

Author:
dndvault
Since:
pre-alpha

Definition at line 31 of file Location.cpp.

References mX, mY, and mZ.

00032 {
00033         bool ret;
00034 
00035         if (this == &l)
00036         {
00037                 return true;
00038         }
00039 
00040         ret = false;
00041         if (
00042                 (mX == l.mX) &&
00043                 (mY == l.mY) &&
00044                 (mZ == l.mZ)
00045                 )
00046         {
00047                 ret = true;
00048         }
00049 
00050         return ret;
00051 }

void Location::setX Uint32  newX  )  [inline]
 

Sets the X coordinate.

Author:
stonedz
Since:
pre-alpha
Parameters:
newX The new X coordinate.

Definition at line 40 of file Location.h.

00040 {mX = newX;}

void Location::setXYZ Uint32  newX,
Uint32  newY,
Uint32  newZ
[inline]
 

Sets the 3 coordinates X Y and Z.

Author:
stonedz
Since:
pre-alpha
Parameters:
newX New X coordinate.
newY New Y coordinate.
newZ New Z coordinate.

Definition at line 87 of file Location.h.

00087                                                        {mX = newX;
00088                                                         mY = newY;
00089                                                         mZ = newZ;}

void Location::setY Uint32  newY  )  [inline]
 

Sets the Y coordinate.

Author:
stonedz
Since:
pre-alpha
Parameters:
newY The new Y coordinate.

Definition at line 58 of file Location.h.

00058 {mY = newY;}

void Location::setZ Uint32  newZ  )  [inline]
 

Sets the Z coordinate.

Author:
stonedz
Since:
pre-alpha
Parameters:
newZ The new Z coordinate.

Definition at line 76 of file Location.h.

00076 {mZ = newZ;}


Member Data Documentation

Uint32 Location::mX [private]
 

My X coordinate.

Definition at line 122 of file Location.h.

Referenced by operator=(), and operator==().

Uint32 Location::mY [private]
 

My Y coordinate.

Definition at line 123 of file Location.h.

Referenced by operator=(), and operator==().

Uint32 Location::mZ [private]
 

My Z coordinate.

Definition at line 124 of file Location.h.

Referenced by operator=(), and operator==().


The documentation for this class was generated from the following files:
Generated on Mon Dec 3 04:30:13 2007 for lo-testserver by  doxygen 1.3.9.1