aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Grids/GridDefines.h
diff options
context:
space:
mode:
authormegamage <none@none.none>2011-10-18 11:05:32 -0400
committermegamage <none@none.none>2011-10-18 11:05:32 -0400
commite0d933fed8ee1a41af92a8279d6216fc83dcfc34 (patch)
tree0fe098ec46766d8eb94d79be3728a106e2e0aaac /src/server/game/Grids/GridDefines.h
parentc29ff410015be2ef8c8c55ba3015940962ff56c3 (diff)
Use method IsCoordValid() to replace explicit checks.
Diffstat (limited to 'src/server/game/Grids/GridDefines.h')
-rw-r--r--src/server/game/Grids/GridDefines.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/server/game/Grids/GridDefines.h b/src/server/game/Grids/GridDefines.h
index 70d38720005..c8abc314ff0 100644
--- a/src/server/game/Grids/GridDefines.h
+++ b/src/server/game/Grids/GridDefines.h
@@ -71,7 +71,7 @@ typedef NGrid<MAX_NUMBER_OF_CELLS, Player, AllWorldObjectTypes, AllGridObjectTyp
typedef TypeMapContainer<AllGridObjectTypes> GridTypeMapContainer;
typedef TypeMapContainer<AllWorldObjectTypes> WorldTypeMapContainer;
-template<const unsigned int LIMIT>
+template<uint32 LIMIT>
struct CoordPair
{
CoordPair(uint32 x=0, uint32 y=0)
@@ -123,17 +123,22 @@ struct CoordPair
y_coord = LIMIT - 1;
}
+ bool IsCoordValid() const
+ {
+ return x_coord < LIMIT && y_coord < LIMIT;
+ }
+
uint32 x_coord;
uint32 y_coord;
};
-template<const unsigned int LIMIT>
+template<uint32 LIMIT>
bool operator==(const CoordPair<LIMIT> &p1, const CoordPair<LIMIT> &p2)
{
return (p1.x_coord == p2.x_coord && p1.y_coord == p2.y_coord);
}
-template<const unsigned int LIMIT>
+template<uint32 LIMIT>
bool operator!=(const CoordPair<LIMIT> &p1, const CoordPair<LIMIT> &p2)
{
return !(p1 == p2);