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.
This commit is contained in:
megamage
2011-10-18 10:53:34 -04:00
parent e3f8588a22
commit c29ff41001
39 changed files with 197 additions and 197 deletions
+8 -8
View File
@@ -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)