diff options
author | megamage <none@none.none> | 2011-10-18 10:53:34 -0400 |
---|---|---|
committer | megamage <none@none.none> | 2011-10-18 10:53:34 -0400 |
commit | c29ff410015be2ef8c8c55ba3015940962ff56c3 (patch) | |
tree | d2b5b36bbf32bbb695ef0f1456a461294609fd06 /src/server/game/Grids/GridDefines.h | |
parent | e3f8588a227cbf9108f396131a199d75868bf539 (diff) |
Rename some classes in grid system.
Note: The naming of classes is still confusing. "cell" usually refers to class "Grid", and "grid" usually refers to class "NGrid". But it requires a lot of changes to clean this up.
Diffstat (limited to 'src/server/game/Grids/GridDefines.h')
-rw-r--r--[-rwxr-xr-x] | src/server/game/Grids/GridDefines.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/server/game/Grids/GridDefines.h b/src/server/game/Grids/GridDefines.h index 0bd5a2db71c..70d38720005 100755..100644 --- a/src/server/game/Grids/GridDefines.h +++ b/src/server/game/Grids/GridDefines.h @@ -139,8 +139,8 @@ bool operator!=(const CoordPair<LIMIT> &p1, const CoordPair<LIMIT> &p2) return !(p1 == p2); } -typedef CoordPair<MAX_NUMBER_OF_GRIDS> GridPair; -typedef CoordPair<TOTAL_NUMBER_OF_CELLS_PER_MAP> CellPair; +typedef CoordPair<MAX_NUMBER_OF_GRIDS> GridCoord; +typedef CoordPair<TOTAL_NUMBER_OF_CELLS_PER_MAP> CellCoord; namespace Trinity { @@ -156,17 +156,17 @@ namespace Trinity return RET_TYPE(x_val, y_val); } - inline GridPair ComputeGridPair(float x, float y) + inline GridCoord ComputeGridCoord(float x, float y) { - return Compute<GridPair, CENTER_GRID_ID>(x, y, CENTER_GRID_OFFSET, SIZE_OF_GRIDS); + return Compute<GridCoord, CENTER_GRID_ID>(x, y, CENTER_GRID_OFFSET, SIZE_OF_GRIDS); } - inline CellPair ComputeCellPair(float x, float y) + inline CellCoord ComputeCellCoord(float x, float y) { - return Compute<CellPair, CENTER_GRID_CELL_ID>(x, y, CENTER_GRID_CELL_OFFSET, SIZE_OF_GRID_CELL); + return Compute<CellCoord, CENTER_GRID_CELL_ID>(x, y, CENTER_GRID_CELL_OFFSET, SIZE_OF_GRID_CELL); } - inline CellPair ComputeCellPair(float x, float y, float &x_off, float &y_off) + inline CellCoord ComputeCellCoord(float x, float y, float &x_off, float &y_off) { double x_offset = (double(x) - CENTER_GRID_CELL_OFFSET)/SIZE_OF_GRID_CELL; double y_offset = (double(y) - CENTER_GRID_CELL_OFFSET)/SIZE_OF_GRID_CELL; @@ -175,7 +175,7 @@ namespace Trinity int y_val = int(y_offset + CENTER_GRID_CELL_ID + 0.5f); x_off = (float(x_offset) - x_val + CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL; y_off = (float(y_offset) - y_val + CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL; - return CellPair(x_val, y_val); + return CellCoord(x_val, y_val); } inline void NormalizeMapCoord(float &c) |