mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 07:06:23 +00:00
refactor(Core/Game): restyle game lib with astyle (#3466)
This commit is contained in:
@@ -39,22 +39,22 @@ struct Cell
|
||||
explicit Cell(CellCoord const& p);
|
||||
explicit Cell(float x, float y);
|
||||
|
||||
void Compute(uint32 &x, uint32 &y) const
|
||||
void Compute(uint32& x, uint32& y) const
|
||||
{
|
||||
x = data.Part.grid_x * MAX_NUMBER_OF_CELLS + data.Part.cell_x;
|
||||
y = data.Part.grid_y * MAX_NUMBER_OF_CELLS + data.Part.cell_y;
|
||||
}
|
||||
|
||||
bool DiffCell(const Cell &cell) const
|
||||
bool DiffCell(const Cell& cell) const
|
||||
{
|
||||
return(data.Part.cell_x != cell.data.Part.cell_x ||
|
||||
data.Part.cell_y != cell.data.Part.cell_y);
|
||||
data.Part.cell_y != cell.data.Part.cell_y);
|
||||
}
|
||||
|
||||
bool DiffGrid(const Cell &cell) const
|
||||
bool DiffGrid(const Cell& cell) const
|
||||
{
|
||||
return(data.Part.grid_x != cell.data.Part.grid_x ||
|
||||
data.Part.grid_y != cell.data.Part.grid_y);
|
||||
data.Part.grid_y != cell.data.Part.grid_y);
|
||||
}
|
||||
|
||||
uint32 CellX() const { return data.Part.cell_x; }
|
||||
@@ -67,8 +67,8 @@ struct Cell
|
||||
CellCoord GetCellCoord() const
|
||||
{
|
||||
return CellCoord(
|
||||
data.Part.grid_x * MAX_NUMBER_OF_CELLS+data.Part.cell_x,
|
||||
data.Part.grid_y * MAX_NUMBER_OF_CELLS+data.Part.cell_y);
|
||||
data.Part.grid_x * MAX_NUMBER_OF_CELLS + data.Part.cell_x,
|
||||
data.Part.grid_y * MAX_NUMBER_OF_CELLS + data.Part.cell_y);
|
||||
}
|
||||
|
||||
Cell& operator=(Cell const& cell)
|
||||
@@ -93,13 +93,13 @@ struct Cell
|
||||
uint32 All;
|
||||
} data;
|
||||
|
||||
template<class T, class CONTAINER> void Visit(CellCoord const&, TypeContainerVisitor<T, CONTAINER>& visitor, Map &, WorldObject const&, float) const;
|
||||
template<class T, class CONTAINER> void Visit(CellCoord const&, TypeContainerVisitor<T, CONTAINER>& visitor, Map &, float, float, float) const;
|
||||
template<class T, class CONTAINER> void Visit(CellCoord const&, TypeContainerVisitor<T, CONTAINER>& visitor, Map&, WorldObject const&, float) const;
|
||||
template<class T, class CONTAINER> void Visit(CellCoord const&, TypeContainerVisitor<T, CONTAINER>& visitor, Map&, float, float, float) const;
|
||||
|
||||
static CellArea CalculateCellArea(float x, float y, float radius);
|
||||
|
||||
private:
|
||||
template<class T, class CONTAINER> void VisitCircle(TypeContainerVisitor<T, CONTAINER> &, Map &, CellCoord const&, CellCoord const&) const;
|
||||
template<class T, class CONTAINER> void VisitCircle(TypeContainerVisitor<T, CONTAINER>&, Map&, CellCoord const&, CellCoord const&) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -27,97 +27,97 @@ template<class A, class T, class O> class GridLoader;
|
||||
|
||||
template
|
||||
<
|
||||
class ACTIVE_OBJECT,
|
||||
class WORLD_OBJECT_TYPES,
|
||||
class GRID_OBJECT_TYPES
|
||||
>
|
||||
class ACTIVE_OBJECT,
|
||||
class WORLD_OBJECT_TYPES,
|
||||
class GRID_OBJECT_TYPES
|
||||
>
|
||||
class Grid
|
||||
{
|
||||
// allows the GridLoader to access its internals
|
||||
template<class A, class T, class O> friend class GridLoader;
|
||||
public:
|
||||
public:
|
||||
|
||||
/** destructor to clean up its resources. This includes unloading the
|
||||
grid if it has not been unload.
|
||||
*/
|
||||
~Grid() {}
|
||||
/** destructor to clean up its resources. This includes unloading the
|
||||
grid if it has not been unload.
|
||||
*/
|
||||
~Grid() {}
|
||||
|
||||
/** an object of interested enters the grid
|
||||
*/
|
||||
template<class SPECIFIC_OBJECT> void AddWorldObject(SPECIFIC_OBJECT *obj)
|
||||
{
|
||||
i_objects.template insert<SPECIFIC_OBJECT>(obj);
|
||||
ASSERT(obj->IsInGrid());
|
||||
}
|
||||
/** an object of interested enters the grid
|
||||
*/
|
||||
template<class SPECIFIC_OBJECT> void AddWorldObject(SPECIFIC_OBJECT* obj)
|
||||
{
|
||||
i_objects.template insert<SPECIFIC_OBJECT>(obj);
|
||||
ASSERT(obj->IsInGrid());
|
||||
}
|
||||
|
||||
/** an object of interested exits the grid
|
||||
*/
|
||||
//Actually an unlink is enough, no need to go through the container
|
||||
//template<class SPECIFIC_OBJECT> void RemoveWorldObject(SPECIFIC_OBJECT *obj)
|
||||
//{
|
||||
// ASSERT(obj->GetGridRef().isValid());
|
||||
// i_objects.template remove<SPECIFIC_OBJECT>(obj);
|
||||
// ASSERT(!obj->GetGridRef().isValid());
|
||||
//}
|
||||
/** an object of interested exits the grid
|
||||
*/
|
||||
//Actually an unlink is enough, no need to go through the container
|
||||
//template<class SPECIFIC_OBJECT> void RemoveWorldObject(SPECIFIC_OBJECT *obj)
|
||||
//{
|
||||
// ASSERT(obj->GetGridRef().isValid());
|
||||
// i_objects.template remove<SPECIFIC_OBJECT>(obj);
|
||||
// ASSERT(!obj->GetGridRef().isValid());
|
||||
//}
|
||||
|
||||
/** Refreshes/update the grid. This required for remote grids.
|
||||
*/
|
||||
//void RefreshGrid(void) { /* TBI */}
|
||||
/** Refreshes/update the grid. This required for remote grids.
|
||||
*/
|
||||
//void RefreshGrid(void) { /* TBI */}
|
||||
|
||||
/** Locks a grid. Any object enters must wait until the grid is unlock.
|
||||
*/
|
||||
//void LockGrid(void) { /* TBI */ }
|
||||
/** Locks a grid. Any object enters must wait until the grid is unlock.
|
||||
*/
|
||||
//void LockGrid(void) { /* TBI */ }
|
||||
|
||||
/** Unlocks the grid.
|
||||
*/
|
||||
//void UnlockGrid(void) { /* TBI */ }
|
||||
/** Unlocks the grid.
|
||||
*/
|
||||
//void UnlockGrid(void) { /* TBI */ }
|
||||
|
||||
// Visit grid objects
|
||||
template<class T>
|
||||
void Visit(TypeContainerVisitor<T, TypeMapContainer<GRID_OBJECT_TYPES> > &visitor)
|
||||
{
|
||||
visitor.Visit(i_container);
|
||||
}
|
||||
// Visit grid objects
|
||||
template<class T>
|
||||
void Visit(TypeContainerVisitor<T, TypeMapContainer<GRID_OBJECT_TYPES> >& visitor)
|
||||
{
|
||||
visitor.Visit(i_container);
|
||||
}
|
||||
|
||||
// Visit world objects
|
||||
template<class T>
|
||||
void Visit(TypeContainerVisitor<T, TypeMapContainer<WORLD_OBJECT_TYPES> > &visitor)
|
||||
{
|
||||
visitor.Visit(i_objects);
|
||||
}
|
||||
// Visit world objects
|
||||
template<class T>
|
||||
void Visit(TypeContainerVisitor<T, TypeMapContainer<WORLD_OBJECT_TYPES> >& visitor)
|
||||
{
|
||||
visitor.Visit(i_objects);
|
||||
}
|
||||
|
||||
/** Inserts a container type object into the grid.
|
||||
*/
|
||||
template<class SPECIFIC_OBJECT> void AddGridObject(SPECIFIC_OBJECT *obj)
|
||||
{
|
||||
i_container.template insert<SPECIFIC_OBJECT>(obj);
|
||||
ASSERT(obj->IsInGrid());
|
||||
}
|
||||
/** Inserts a container type object into the grid.
|
||||
*/
|
||||
template<class SPECIFIC_OBJECT> void AddGridObject(SPECIFIC_OBJECT* obj)
|
||||
{
|
||||
i_container.template insert<SPECIFIC_OBJECT>(obj);
|
||||
ASSERT(obj->IsInGrid());
|
||||
}
|
||||
|
||||
/** Removes a containter type object from the grid
|
||||
*/
|
||||
//template<class SPECIFIC_OBJECT> void RemoveGridObject(SPECIFIC_OBJECT *obj)
|
||||
//{
|
||||
// ASSERT(obj->GetGridRef().isValid());
|
||||
// i_container.template remove<SPECIFIC_OBJECT>(obj);
|
||||
// ASSERT(!obj->GetGridRef().isValid());
|
||||
//}
|
||||
/** Removes a containter type object from the grid
|
||||
*/
|
||||
//template<class SPECIFIC_OBJECT> void RemoveGridObject(SPECIFIC_OBJECT *obj)
|
||||
//{
|
||||
// ASSERT(obj->GetGridRef().isValid());
|
||||
// i_container.template remove<SPECIFIC_OBJECT>(obj);
|
||||
// ASSERT(!obj->GetGridRef().isValid());
|
||||
//}
|
||||
|
||||
/*bool NoWorldObjectInGrid() const
|
||||
{
|
||||
return i_objects.GetElements().isEmpty();
|
||||
}
|
||||
/*bool NoWorldObjectInGrid() const
|
||||
{
|
||||
return i_objects.GetElements().isEmpty();
|
||||
}
|
||||
|
||||
bool NoGridObjectInGrid() const
|
||||
{
|
||||
return i_container.GetElements().isEmpty();
|
||||
}*/
|
||||
private:
|
||||
bool NoGridObjectInGrid() const
|
||||
{
|
||||
return i_container.GetElements().isEmpty();
|
||||
}*/
|
||||
private:
|
||||
|
||||
TypeMapContainer<GRID_OBJECT_TYPES> i_container;
|
||||
TypeMapContainer<WORLD_OBJECT_TYPES> i_objects;
|
||||
//typedef std::set<void*> ActiveGridObjects;
|
||||
//ActiveGridObjects m_activeGridObjects;
|
||||
TypeMapContainer<GRID_OBJECT_TYPES> i_container;
|
||||
TypeMapContainer<WORLD_OBJECT_TYPES> i_objects;
|
||||
//typedef std::set<void*> ActiveGridObjects;
|
||||
//ActiveGridObjects m_activeGridObjects;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -72,17 +72,17 @@ typedef TypeMapContainer<AllWorldObjectTypes> WorldTypeMapContainer;
|
||||
template<uint32 LIMIT>
|
||||
struct CoordPair
|
||||
{
|
||||
CoordPair(uint32 x=0, uint32 y=0)
|
||||
CoordPair(uint32 x = 0, uint32 y = 0)
|
||||
: x_coord(x)
|
||||
, y_coord(y)
|
||||
{}
|
||||
|
||||
CoordPair(const CoordPair<LIMIT> &obj)
|
||||
CoordPair(const CoordPair<LIMIT>& obj)
|
||||
: x_coord(obj.x_coord)
|
||||
, y_coord(obj.y_coord)
|
||||
{}
|
||||
|
||||
CoordPair<LIMIT> & operator=(const CoordPair<LIMIT> &obj)
|
||||
CoordPair<LIMIT>& operator=(const CoordPair<LIMIT>& obj)
|
||||
{
|
||||
x_coord = obj.x_coord;
|
||||
y_coord = obj.y_coord;
|
||||
@@ -143,13 +143,13 @@ struct CoordPair
|
||||
};
|
||||
|
||||
template<uint32 LIMIT>
|
||||
bool operator==(const CoordPair<LIMIT> &p1, const CoordPair<LIMIT> &p2)
|
||||
bool operator==(const CoordPair<LIMIT>& p1, const CoordPair<LIMIT>& p2)
|
||||
{
|
||||
return (p1.x_coord == p2.x_coord && p1.y_coord == p2.y_coord);
|
||||
}
|
||||
|
||||
template<uint32 LIMIT>
|
||||
bool operator!=(const CoordPair<LIMIT> &p1, const CoordPair<LIMIT> &p2)
|
||||
bool operator!=(const CoordPair<LIMIT>& p1, const CoordPair<LIMIT>& p2)
|
||||
{
|
||||
return !(p1 == p2);
|
||||
}
|
||||
@@ -163,8 +163,8 @@ namespace acore
|
||||
inline RET_TYPE Compute(float x, float y, float center_offset, float size)
|
||||
{
|
||||
// calculate and store temporary values in double format for having same result as same mySQL calculations
|
||||
double x_offset = (double(x) - center_offset)/size;
|
||||
double y_offset = (double(y) - center_offset)/size;
|
||||
double x_offset = (double(x) - center_offset) / size;
|
||||
double y_offset = (double(y) - center_offset) / size;
|
||||
|
||||
int x_val = int(x_offset + CENTER_VAL + 0.5f);
|
||||
int y_val = int(y_offset + CENTER_VAL + 0.5f);
|
||||
@@ -181,10 +181,10 @@ namespace acore
|
||||
return Compute<CellCoord, CENTER_GRID_CELL_ID>(x, y, CENTER_GRID_CELL_OFFSET, SIZE_OF_GRID_CELL);
|
||||
}
|
||||
|
||||
inline CellCoord ComputeCellCoord(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;
|
||||
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;
|
||||
|
||||
int x_val = int(x_offset + CENTER_GRID_CELL_ID + 0.5f);
|
||||
int y_val = int(y_offset + CENTER_GRID_CELL_ID + 0.5f);
|
||||
@@ -193,7 +193,7 @@ namespace acore
|
||||
return CellCoord(x_val, y_val);
|
||||
}
|
||||
|
||||
inline void NormalizeMapCoord(float &c)
|
||||
inline void NormalizeMapCoord(float& c)
|
||||
{
|
||||
if (c > MAP_HALFSIZE - 0.5f)
|
||||
c = MAP_HALFSIZE - 0.5f;
|
||||
|
||||
@@ -15,16 +15,16 @@ class GridReference;
|
||||
template<class OBJECT>
|
||||
class GridRefManager : public RefManager<GridRefManager<OBJECT>, OBJECT>
|
||||
{
|
||||
public:
|
||||
typedef LinkedListHead::Iterator< GridReference<OBJECT> > iterator;
|
||||
public:
|
||||
typedef LinkedListHead::Iterator< GridReference<OBJECT> > iterator;
|
||||
|
||||
GridReference<OBJECT>* getFirst() { return (GridReference<OBJECT>*)RefManager<GridRefManager<OBJECT>, OBJECT>::getFirst(); }
|
||||
GridReference<OBJECT>* getLast() { return (GridReference<OBJECT>*)RefManager<GridRefManager<OBJECT>, OBJECT>::getLast(); }
|
||||
GridReference<OBJECT>* getFirst() { return (GridReference<OBJECT>*)RefManager<GridRefManager<OBJECT>, OBJECT>::getFirst(); }
|
||||
GridReference<OBJECT>* getLast() { return (GridReference<OBJECT>*)RefManager<GridRefManager<OBJECT>, OBJECT>::getLast(); }
|
||||
|
||||
iterator begin() { return iterator(getFirst()); }
|
||||
iterator end() { return iterator(nullptr); }
|
||||
iterator rbegin() { return iterator(getLast()); }
|
||||
iterator rend() { return iterator(nullptr); }
|
||||
iterator begin() { return iterator(getFirst()); }
|
||||
iterator end() { return iterator(nullptr); }
|
||||
iterator rbegin() { return iterator(getLast()); }
|
||||
iterator rend() { return iterator(nullptr); }
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -15,27 +15,27 @@ class GridRefManager;
|
||||
template<class OBJECT>
|
||||
class GridReference : public Reference<GridRefManager<OBJECT>, OBJECT>
|
||||
{
|
||||
protected:
|
||||
void targetObjectBuildLink()
|
||||
{
|
||||
// called from link()
|
||||
this->getTarget()->insertFirst(this);
|
||||
this->getTarget()->incSize();
|
||||
}
|
||||
void targetObjectDestroyLink()
|
||||
{
|
||||
// called from unlink()
|
||||
if (this->isValid()) this->getTarget()->decSize();
|
||||
}
|
||||
void sourceObjectDestroyLink()
|
||||
{
|
||||
// called from invalidate()
|
||||
this->getTarget()->decSize();
|
||||
}
|
||||
public:
|
||||
GridReference() : Reference<GridRefManager<OBJECT>, OBJECT>() {}
|
||||
~GridReference() { this->unlink(); }
|
||||
GridReference* next() { return (GridReference*)Reference<GridRefManager<OBJECT>, OBJECT>::next(); }
|
||||
protected:
|
||||
void targetObjectBuildLink()
|
||||
{
|
||||
// called from link()
|
||||
this->getTarget()->insertFirst(this);
|
||||
this->getTarget()->incSize();
|
||||
}
|
||||
void targetObjectDestroyLink()
|
||||
{
|
||||
// called from unlink()
|
||||
if (this->isValid()) this->getTarget()->decSize();
|
||||
}
|
||||
void sourceObjectDestroyLink()
|
||||
{
|
||||
// called from invalidate()
|
||||
this->getTarget()->decSize();
|
||||
}
|
||||
public:
|
||||
GridReference() : Reference<GridRefManager<OBJECT>, OBJECT>() {}
|
||||
~GridReference() { this->unlink(); }
|
||||
GridReference* next() { return (GridReference*)Reference<GridRefManager<OBJECT>, OBJECT>::next(); }
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -17,88 +17,88 @@
|
||||
|
||||
template
|
||||
<
|
||||
uint32 N,
|
||||
class ACTIVE_OBJECT,
|
||||
class WORLD_OBJECT_TYPES,
|
||||
class GRID_OBJECT_TYPES
|
||||
>
|
||||
uint32 N,
|
||||
class ACTIVE_OBJECT,
|
||||
class WORLD_OBJECT_TYPES,
|
||||
class GRID_OBJECT_TYPES
|
||||
>
|
||||
class NGrid
|
||||
{
|
||||
public:
|
||||
typedef Grid<ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> GridType;
|
||||
NGrid(uint32 id, int32 x, int32 y)
|
||||
: i_gridId(id), i_x(x), i_y(y), i_GridObjectDataLoaded(false)
|
||||
{
|
||||
}
|
||||
public:
|
||||
typedef Grid<ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> GridType;
|
||||
NGrid(uint32 id, int32 x, int32 y)
|
||||
: i_gridId(id), i_x(x), i_y(y), i_GridObjectDataLoaded(false)
|
||||
{
|
||||
}
|
||||
|
||||
GridType& GetGridType(const uint32 x, const uint32 y)
|
||||
{
|
||||
ASSERT(x < N && y < N);
|
||||
return i_cells[x][y];
|
||||
}
|
||||
GridType& GetGridType(const uint32 x, const uint32 y)
|
||||
{
|
||||
ASSERT(x < N && y < N);
|
||||
return i_cells[x][y];
|
||||
}
|
||||
|
||||
GridType const& GetGridType(const uint32 x, const uint32 y) const
|
||||
{
|
||||
ASSERT(x < N && y < N);
|
||||
return i_cells[x][y];
|
||||
}
|
||||
GridType const& GetGridType(const uint32 x, const uint32 y) const
|
||||
{
|
||||
ASSERT(x < N && y < N);
|
||||
return i_cells[x][y];
|
||||
}
|
||||
|
||||
uint32 GetGridId(void) const { return i_gridId; }
|
||||
int32 getX() const { return i_x; }
|
||||
int32 getY() const { return i_y; }
|
||||
uint32 GetGridId(void) const { return i_gridId; }
|
||||
int32 getX() const { return i_x; }
|
||||
int32 getY() const { return i_y; }
|
||||
|
||||
void link(GridRefManager<NGrid<N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> >* pTo)
|
||||
{
|
||||
i_Reference.link(pTo, this);
|
||||
}
|
||||
bool isGridObjectDataLoaded() const { return i_GridObjectDataLoaded; }
|
||||
void setGridObjectDataLoaded(bool pLoaded) { i_GridObjectDataLoaded = pLoaded; }
|
||||
void link(GridRefManager<NGrid<N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> >* pTo)
|
||||
{
|
||||
i_Reference.link(pTo, this);
|
||||
}
|
||||
bool isGridObjectDataLoaded() const { return i_GridObjectDataLoaded; }
|
||||
void setGridObjectDataLoaded(bool pLoaded) { i_GridObjectDataLoaded = pLoaded; }
|
||||
|
||||
/*
|
||||
template<class SPECIFIC_OBJECT> void AddWorldObject(const uint32 x, const uint32 y, SPECIFIC_OBJECT *obj)
|
||||
{
|
||||
GetGridType(x, y).AddWorldObject(obj);
|
||||
}
|
||||
/*
|
||||
template<class SPECIFIC_OBJECT> void AddWorldObject(const uint32 x, const uint32 y, SPECIFIC_OBJECT *obj)
|
||||
{
|
||||
GetGridType(x, y).AddWorldObject(obj);
|
||||
}
|
||||
|
||||
template<class SPECIFIC_OBJECT> void RemoveWorldObject(const uint32 x, const uint32 y, SPECIFIC_OBJECT *obj)
|
||||
{
|
||||
GetGridType(x, y).RemoveWorldObject(obj);
|
||||
}
|
||||
template<class SPECIFIC_OBJECT> void RemoveWorldObject(const uint32 x, const uint32 y, SPECIFIC_OBJECT *obj)
|
||||
{
|
||||
GetGridType(x, y).RemoveWorldObject(obj);
|
||||
}
|
||||
|
||||
template<class SPECIFIC_OBJECT> void AddGridObject(const uint32 x, const uint32 y, SPECIFIC_OBJECT *obj)
|
||||
{
|
||||
GetGridType(x, y).AddGridObject(obj);
|
||||
}
|
||||
template<class SPECIFIC_OBJECT> void AddGridObject(const uint32 x, const uint32 y, SPECIFIC_OBJECT *obj)
|
||||
{
|
||||
GetGridType(x, y).AddGridObject(obj);
|
||||
}
|
||||
|
||||
template<class SPECIFIC_OBJECT> void RemoveGridObject(const uint32 x, const uint32 y, SPECIFIC_OBJECT *obj)
|
||||
{
|
||||
GetGridType(x, y).RemoveGridObject(obj);
|
||||
}
|
||||
*/
|
||||
template<class SPECIFIC_OBJECT> void RemoveGridObject(const uint32 x, const uint32 y, SPECIFIC_OBJECT *obj)
|
||||
{
|
||||
GetGridType(x, y).RemoveGridObject(obj);
|
||||
}
|
||||
*/
|
||||
|
||||
// Visit all Grids (cells) in NGrid (grid)
|
||||
template<class T, class TT>
|
||||
void VisitAllGrids(TypeContainerVisitor<T, TypeMapContainer<TT> > &visitor)
|
||||
{
|
||||
for (uint32 x = 0; x < N; ++x)
|
||||
for (uint32 y = 0; y < N; ++y)
|
||||
GetGridType(x, y).Visit(visitor);
|
||||
}
|
||||
// Visit all Grids (cells) in NGrid (grid)
|
||||
template<class T, class TT>
|
||||
void VisitAllGrids(TypeContainerVisitor<T, TypeMapContainer<TT> >& visitor)
|
||||
{
|
||||
for (uint32 x = 0; x < N; ++x)
|
||||
for (uint32 y = 0; y < N; ++y)
|
||||
GetGridType(x, y).Visit(visitor);
|
||||
}
|
||||
|
||||
// Visit a single Grid (cell) in NGrid (grid)
|
||||
template<class T, class TT>
|
||||
void VisitGrid(const uint32 x, const uint32 y, TypeContainerVisitor<T, TypeMapContainer<TT> > &visitor)
|
||||
{
|
||||
GetGridType(x, y).Visit(visitor);
|
||||
}
|
||||
// Visit a single Grid (cell) in NGrid (grid)
|
||||
template<class T, class TT>
|
||||
void VisitGrid(const uint32 x, const uint32 y, TypeContainerVisitor<T, TypeMapContainer<TT> >& visitor)
|
||||
{
|
||||
GetGridType(x, y).Visit(visitor);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 i_gridId;
|
||||
GridReference<NGrid<N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> > i_Reference;
|
||||
int32 i_x;
|
||||
int32 i_y;
|
||||
GridType i_cells[N][N];
|
||||
bool i_GridObjectDataLoaded;
|
||||
private:
|
||||
uint32 i_gridId;
|
||||
GridReference<NGrid<N, ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> > i_Reference;
|
||||
int32 i_x;
|
||||
int32 i_y;
|
||||
GridType i_cells[N][N];
|
||||
bool i_GridObjectDataLoaded;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
using namespace acore;
|
||||
|
||||
|
||||
void VisibleNotifier::Visit(GameObjectMapType &m)
|
||||
void VisibleNotifier::Visit(GameObjectMapType& m)
|
||||
{
|
||||
for (GameObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
@@ -35,7 +35,7 @@ void VisibleNotifier::SendToSelf()
|
||||
// at this moment i_clientGUIDs have guids that not iterate at grid level checks
|
||||
// but exist one case when this possible and object not out of range: transports
|
||||
if (Transport* transport = i_player.GetTransport())
|
||||
for (Transport::PassengerSet::const_iterator itr = transport->GetPassengers().begin(); itr != transport->GetPassengers().end();++itr)
|
||||
for (Transport::PassengerSet::const_iterator itr = transport->GetPassengers().begin(); itr != transport->GetPassengers().end(); ++itr)
|
||||
{
|
||||
if (i_largeOnly != (*itr)->IsVisibilityOverridden())
|
||||
continue;
|
||||
@@ -62,7 +62,7 @@ void VisibleNotifier::SendToSelf()
|
||||
}
|
||||
}
|
||||
|
||||
for (Player::ClientGUIDs::const_iterator it = vis_guids.begin();it != vis_guids.end(); ++it)
|
||||
for (Player::ClientGUIDs::const_iterator it = vis_guids.begin(); it != vis_guids.end(); ++it)
|
||||
{
|
||||
if (WorldObject* obj = ObjectAccessor::GetWorldObject(i_player, *it))
|
||||
if (i_largeOnly != obj->IsVisibilityOverridden())
|
||||
@@ -100,7 +100,7 @@ void VisibleNotifier::SendToSelf()
|
||||
}
|
||||
}
|
||||
|
||||
void VisibleChangesNotifier::Visit(PlayerMapType &m)
|
||||
void VisibleChangesNotifier::Visit(PlayerMapType& m)
|
||||
{
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
@@ -116,7 +116,7 @@ void VisibleChangesNotifier::Visit(PlayerMapType &m)
|
||||
}
|
||||
}
|
||||
|
||||
void VisibleChangesNotifier::Visit(CreatureMapType &m)
|
||||
void VisibleChangesNotifier::Visit(CreatureMapType& m)
|
||||
{
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
if (iter->GetSource()->HasSharedVision())
|
||||
@@ -125,7 +125,7 @@ void VisibleChangesNotifier::Visit(CreatureMapType &m)
|
||||
(*i)->UpdateVisibilityOf(&i_object);
|
||||
}
|
||||
|
||||
void VisibleChangesNotifier::Visit(DynamicObjectMapType &m)
|
||||
void VisibleChangesNotifier::Visit(DynamicObjectMapType& m)
|
||||
{
|
||||
for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
if (IS_PLAYER_GUID(iter->GetSource()->GetCasterGUID()))
|
||||
@@ -154,7 +154,7 @@ inline void CreatureUnitRelocationWorker(Creature* c, Unit* u)
|
||||
}
|
||||
}
|
||||
|
||||
void PlayerRelocationNotifier::Visit(PlayerMapType &m)
|
||||
void PlayerRelocationNotifier::Visit(PlayerMapType& m)
|
||||
{
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
@@ -165,7 +165,7 @@ void PlayerRelocationNotifier::Visit(PlayerMapType &m)
|
||||
}
|
||||
}
|
||||
|
||||
void CreatureRelocationNotifier::Visit(PlayerMapType &m)
|
||||
void CreatureRelocationNotifier::Visit(PlayerMapType& m)
|
||||
{
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
@@ -181,7 +181,7 @@ void CreatureRelocationNotifier::Visit(PlayerMapType &m)
|
||||
}
|
||||
}
|
||||
|
||||
void AIRelocationNotifier::Visit(CreatureMapType &m)
|
||||
void AIRelocationNotifier::Visit(CreatureMapType& m)
|
||||
{
|
||||
bool self = isCreature && !((Creature*)(&i_unit))->IsMoveInLineOfSightStrictlyDisabled();
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
@@ -197,7 +197,7 @@ void AIRelocationNotifier::Visit(CreatureMapType &m)
|
||||
}
|
||||
}
|
||||
|
||||
void MessageDistDeliverer::Visit(PlayerMapType &m)
|
||||
void MessageDistDeliverer::Visit(PlayerMapType& m)
|
||||
{
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
@@ -222,7 +222,7 @@ void MessageDistDeliverer::Visit(PlayerMapType &m)
|
||||
}
|
||||
}
|
||||
|
||||
void MessageDistDeliverer::Visit(CreatureMapType &m)
|
||||
void MessageDistDeliverer::Visit(CreatureMapType& m)
|
||||
{
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
@@ -241,7 +241,7 @@ void MessageDistDeliverer::Visit(CreatureMapType &m)
|
||||
}
|
||||
}
|
||||
|
||||
void MessageDistDeliverer::Visit(DynamicObjectMapType &m)
|
||||
void MessageDistDeliverer::Visit(DynamicObjectMapType& m)
|
||||
{
|
||||
for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
@@ -263,7 +263,7 @@ void MessageDistDeliverer::Visit(DynamicObjectMapType &m)
|
||||
}
|
||||
}
|
||||
|
||||
void MessageDistDelivererToHostile::Visit(PlayerMapType &m)
|
||||
void MessageDistDelivererToHostile::Visit(PlayerMapType& m)
|
||||
{
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
@@ -288,7 +288,7 @@ void MessageDistDelivererToHostile::Visit(PlayerMapType &m)
|
||||
}
|
||||
}
|
||||
|
||||
void MessageDistDelivererToHostile::Visit(CreatureMapType &m)
|
||||
void MessageDistDelivererToHostile::Visit(CreatureMapType& m)
|
||||
{
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
@@ -307,7 +307,7 @@ void MessageDistDelivererToHostile::Visit(CreatureMapType &m)
|
||||
}
|
||||
}
|
||||
|
||||
void MessageDistDelivererToHostile::Visit(DynamicObjectMapType &m)
|
||||
void MessageDistDelivererToHostile::Visit(DynamicObjectMapType& m)
|
||||
{
|
||||
for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
@@ -326,7 +326,7 @@ void MessageDistDelivererToHostile::Visit(DynamicObjectMapType &m)
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void ObjectUpdater::Visit(GridRefManager<T> &m)
|
||||
void ObjectUpdater::Visit(GridRefManager<T>& m)
|
||||
{
|
||||
T* obj;
|
||||
for (typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); )
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,7 @@
|
||||
#include "Opcodes.h"
|
||||
|
||||
template<class T>
|
||||
inline void acore::VisibleNotifier::Visit(GridRefManager<T> &m)
|
||||
inline void acore::VisibleNotifier::Visit(GridRefManager<T>& m)
|
||||
{
|
||||
// Xinef: Update gameobjects only
|
||||
if (i_gobjOnly)
|
||||
@@ -37,7 +37,7 @@ inline void acore::VisibleNotifier::Visit(GridRefManager<T> &m)
|
||||
// WorldObject searchers & workers
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
void acore::WorldObjectSearcher<Check>::Visit(GameObjectMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_GAMEOBJECT))
|
||||
return;
|
||||
@@ -46,7 +46,7 @@ void acore::WorldObjectSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
if (i_object)
|
||||
return;
|
||||
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -60,7 +60,7 @@ void acore::WorldObjectSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectSearcher<Check>::Visit(PlayerMapType &m)
|
||||
void acore::WorldObjectSearcher<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_PLAYER))
|
||||
return;
|
||||
@@ -69,7 +69,7 @@ void acore::WorldObjectSearcher<Check>::Visit(PlayerMapType &m)
|
||||
if (i_object)
|
||||
return;
|
||||
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -83,7 +83,7 @@ void acore::WorldObjectSearcher<Check>::Visit(PlayerMapType &m)
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectSearcher<Check>::Visit(CreatureMapType &m)
|
||||
void acore::WorldObjectSearcher<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CREATURE))
|
||||
return;
|
||||
@@ -92,7 +92,7 @@ void acore::WorldObjectSearcher<Check>::Visit(CreatureMapType &m)
|
||||
if (i_object)
|
||||
return;
|
||||
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -106,7 +106,7 @@ void acore::WorldObjectSearcher<Check>::Visit(CreatureMapType &m)
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectSearcher<Check>::Visit(CorpseMapType &m)
|
||||
void acore::WorldObjectSearcher<Check>::Visit(CorpseMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CORPSE))
|
||||
return;
|
||||
@@ -115,7 +115,7 @@ void acore::WorldObjectSearcher<Check>::Visit(CorpseMapType &m)
|
||||
if (i_object)
|
||||
return;
|
||||
|
||||
for (CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CorpseMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -129,7 +129,7 @@ void acore::WorldObjectSearcher<Check>::Visit(CorpseMapType &m)
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType &m)
|
||||
void acore::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_DYNAMICOBJECT))
|
||||
return;
|
||||
@@ -138,7 +138,7 @@ void acore::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType &m)
|
||||
if (i_object)
|
||||
return;
|
||||
|
||||
for (DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (DynamicObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -153,12 +153,12 @@ void acore::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType &m)
|
||||
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectLastSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
void acore::WorldObjectLastSearcher<Check>::Visit(GameObjectMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_GAMEOBJECT))
|
||||
return;
|
||||
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -169,12 +169,12 @@ void acore::WorldObjectLastSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectLastSearcher<Check>::Visit(PlayerMapType &m)
|
||||
void acore::WorldObjectLastSearcher<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_PLAYER))
|
||||
return;
|
||||
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -185,12 +185,12 @@ void acore::WorldObjectLastSearcher<Check>::Visit(PlayerMapType &m)
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectLastSearcher<Check>::Visit(CreatureMapType &m)
|
||||
void acore::WorldObjectLastSearcher<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CREATURE))
|
||||
return;
|
||||
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -201,12 +201,12 @@ void acore::WorldObjectLastSearcher<Check>::Visit(CreatureMapType &m)
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectLastSearcher<Check>::Visit(CorpseMapType &m)
|
||||
void acore::WorldObjectLastSearcher<Check>::Visit(CorpseMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CORPSE))
|
||||
return;
|
||||
|
||||
for (CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CorpseMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -217,12 +217,12 @@ void acore::WorldObjectLastSearcher<Check>::Visit(CorpseMapType &m)
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectLastSearcher<Check>::Visit(DynamicObjectMapType &m)
|
||||
void acore::WorldObjectLastSearcher<Check>::Visit(DynamicObjectMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_DYNAMICOBJECT))
|
||||
return;
|
||||
|
||||
for (DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (DynamicObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -233,56 +233,56 @@ void acore::WorldObjectLastSearcher<Check>::Visit(DynamicObjectMapType &m)
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectListSearcher<Check>::Visit(PlayerMapType &m)
|
||||
void acore::WorldObjectListSearcher<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_PLAYER))
|
||||
return;
|
||||
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectListSearcher<Check>::Visit(CreatureMapType &m)
|
||||
void acore::WorldObjectListSearcher<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CREATURE))
|
||||
return;
|
||||
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectListSearcher<Check>::Visit(CorpseMapType &m)
|
||||
void acore::WorldObjectListSearcher<Check>::Visit(CorpseMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CORPSE))
|
||||
return;
|
||||
|
||||
for (CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CorpseMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectListSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
void acore::WorldObjectListSearcher<Check>::Visit(GameObjectMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_GAMEOBJECT))
|
||||
return;
|
||||
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::WorldObjectListSearcher<Check>::Visit(DynamicObjectMapType &m)
|
||||
void acore::WorldObjectListSearcher<Check>::Visit(DynamicObjectMapType& m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_DYNAMICOBJECT))
|
||||
return;
|
||||
|
||||
for (DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (DynamicObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
@@ -290,13 +290,13 @@ void acore::WorldObjectListSearcher<Check>::Visit(DynamicObjectMapType &m)
|
||||
// Gameobject searchers
|
||||
|
||||
template<class Check>
|
||||
void acore::GameObjectSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
void acore::GameObjectSearcher<Check>::Visit(GameObjectMapType& m)
|
||||
{
|
||||
// already found
|
||||
if (i_object)
|
||||
return;
|
||||
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -310,9 +310,9 @@ void acore::GameObjectSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::GameObjectLastSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
void acore::GameObjectLastSearcher<Check>::Visit(GameObjectMapType& m)
|
||||
{
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -323,9 +323,9 @@ void acore::GameObjectLastSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::GameObjectListSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
void acore::GameObjectListSearcher<Check>::Visit(GameObjectMapType& m)
|
||||
{
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
@@ -334,13 +334,13 @@ void acore::GameObjectListSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
// Unit searchers
|
||||
|
||||
template<class Check>
|
||||
void acore::UnitSearcher<Check>::Visit(CreatureMapType &m)
|
||||
void acore::UnitSearcher<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
// already found
|
||||
if (i_object)
|
||||
return;
|
||||
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -354,13 +354,13 @@ void acore::UnitSearcher<Check>::Visit(CreatureMapType &m)
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::UnitSearcher<Check>::Visit(PlayerMapType &m)
|
||||
void acore::UnitSearcher<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
// already found
|
||||
if (i_object)
|
||||
return;
|
||||
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -374,9 +374,9 @@ void acore::UnitSearcher<Check>::Visit(PlayerMapType &m)
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::UnitLastSearcher<Check>::Visit(CreatureMapType &m)
|
||||
void acore::UnitLastSearcher<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -387,9 +387,9 @@ void acore::UnitLastSearcher<Check>::Visit(CreatureMapType &m)
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::UnitLastSearcher<Check>::Visit(PlayerMapType &m)
|
||||
void acore::UnitLastSearcher<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -400,18 +400,18 @@ void acore::UnitLastSearcher<Check>::Visit(PlayerMapType &m)
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::UnitListSearcher<Check>::Visit(PlayerMapType &m)
|
||||
void acore::UnitListSearcher<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::UnitListSearcher<Check>::Visit(CreatureMapType &m)
|
||||
void acore::UnitListSearcher<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
@@ -420,13 +420,13 @@ void acore::UnitListSearcher<Check>::Visit(CreatureMapType &m)
|
||||
// Creature searchers
|
||||
|
||||
template<class Check>
|
||||
void acore::CreatureSearcher<Check>::Visit(CreatureMapType &m)
|
||||
void acore::CreatureSearcher<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
// already found
|
||||
if (i_object)
|
||||
return;
|
||||
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -440,9 +440,9 @@ void acore::CreatureSearcher<Check>::Visit(CreatureMapType &m)
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::CreatureLastSearcher<Check>::Visit(CreatureMapType &m)
|
||||
void acore::CreatureLastSearcher<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -453,36 +453,36 @@ void acore::CreatureLastSearcher<Check>::Visit(CreatureMapType &m)
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::CreatureListSearcher<Check>::Visit(CreatureMapType &m)
|
||||
void acore::CreatureListSearcher<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::PlayerListSearcher<Check>::Visit(PlayerMapType &m)
|
||||
void acore::PlayerListSearcher<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::PlayerListSearcherWithSharedVision<Check>::Visit(PlayerMapType &m)
|
||||
void acore::PlayerListSearcherWithSharedVision<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
if (i_check(itr->GetSource(), true))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::PlayerListSearcherWithSharedVision<Check>::Visit(CreatureMapType &m)
|
||||
void acore::PlayerListSearcherWithSharedVision<Check>::Visit(CreatureMapType& m)
|
||||
{
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask) && itr->GetSource()->HasSharedVision())
|
||||
for (SharedVisionList::const_iterator i = itr->GetSource()->GetSharedVisionList().begin(); i != itr->GetSource()->GetSharedVisionList().end(); ++i)
|
||||
if (i_check(*i, false))
|
||||
@@ -490,13 +490,13 @@ void acore::PlayerListSearcherWithSharedVision<Check>::Visit(CreatureMapType &m)
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void acore::PlayerSearcher<Check>::Visit(PlayerMapType &m)
|
||||
void acore::PlayerSearcher<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
// already found
|
||||
if (i_object)
|
||||
return;
|
||||
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -526,7 +526,7 @@ template<class Builder>
|
||||
void acore::LocalizedPacketDo<Builder>::operator()(Player* p)
|
||||
{
|
||||
LocaleConstant loc_idx = p->GetSession()->GetSessionDbLocaleIndex();
|
||||
uint32 cache_idx = loc_idx+1;
|
||||
uint32 cache_idx = loc_idx + 1;
|
||||
WorldPacket* data;
|
||||
|
||||
// create if not cached yet
|
||||
@@ -553,14 +553,14 @@ template<class Builder>
|
||||
void acore::LocalizedPacketListDo<Builder>::operator()(Player* p)
|
||||
{
|
||||
LocaleConstant loc_idx = p->GetSession()->GetSessionDbLocaleIndex();
|
||||
uint32 cache_idx = loc_idx+1;
|
||||
uint32 cache_idx = loc_idx + 1;
|
||||
WorldPacketList* data_list;
|
||||
|
||||
// create if not cached yet
|
||||
if (i_data_cache.size() < cache_idx+1 || i_data_cache[cache_idx].empty())
|
||||
if (i_data_cache.size() < cache_idx + 1 || i_data_cache[cache_idx].empty())
|
||||
{
|
||||
if (i_data_cache.size() < cache_idx+1)
|
||||
i_data_cache.resize(cache_idx+1);
|
||||
if (i_data_cache.size() < cache_idx + 1)
|
||||
i_data_cache.resize(cache_idx + 1);
|
||||
|
||||
data_list = &i_data_cache[cache_idx];
|
||||
|
||||
|
||||
@@ -21,21 +21,21 @@
|
||||
//TODO: to implement npc on transport, also need to load npcs at grid loading
|
||||
class ObjectWorldLoader
|
||||
{
|
||||
public:
|
||||
explicit ObjectWorldLoader(ObjectGridLoader& gloader)
|
||||
: i_cell(gloader.i_cell), i_map(gloader.i_map), i_grid(gloader.i_grid), i_corpses (0)
|
||||
{}
|
||||
public:
|
||||
explicit ObjectWorldLoader(ObjectGridLoader& gloader)
|
||||
: i_cell(gloader.i_cell), i_map(gloader.i_map), i_grid(gloader.i_grid), i_corpses (0)
|
||||
{}
|
||||
|
||||
void Visit(CorpseMapType &m);
|
||||
void Visit(CorpseMapType& m);
|
||||
|
||||
template<class T> void Visit(GridRefManager<T>&) { }
|
||||
template<class T> void Visit(GridRefManager<T>&) { }
|
||||
|
||||
private:
|
||||
Cell i_cell;
|
||||
Map* i_map;
|
||||
public:
|
||||
NGridType &i_grid;
|
||||
uint32 i_corpses;
|
||||
private:
|
||||
Cell i_cell;
|
||||
Map* i_map;
|
||||
public:
|
||||
NGridType& i_grid;
|
||||
uint32 i_corpses;
|
||||
};
|
||||
|
||||
template<class T> void ObjectGridLoader::SetObjectCell(T* /*obj*/, CellCoord const& /*cellCoord*/)
|
||||
@@ -55,7 +55,7 @@ template<> void ObjectGridLoader::SetObjectCell(GameObject* obj, CellCoord const
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void AddObjectHelper(CellCoord &cell, GridRefManager<T> &m, uint32 &count, Map* /*map*/, T *obj)
|
||||
void AddObjectHelper(CellCoord& cell, GridRefManager<T>& m, uint32& count, Map* /*map*/, T* obj)
|
||||
{
|
||||
obj->AddToGrid(m);
|
||||
ObjectGridLoader::SetObjectCell(obj, cell);
|
||||
@@ -64,7 +64,7 @@ void AddObjectHelper(CellCoord &cell, GridRefManager<T> &m, uint32 &count, Map*
|
||||
}
|
||||
|
||||
template <>
|
||||
void AddObjectHelper(CellCoord &cell, CreatureMapType &m, uint32 &count, Map* map, Creature *obj)
|
||||
void AddObjectHelper(CellCoord& cell, CreatureMapType& m, uint32& count, Map* map, Creature* obj)
|
||||
{
|
||||
obj->AddToGrid(m);
|
||||
ObjectGridLoader::SetObjectCell(obj, cell);
|
||||
@@ -76,7 +76,7 @@ void AddObjectHelper(CellCoord &cell, CreatureMapType &m, uint32 &count, Map* ma
|
||||
}
|
||||
|
||||
template <>
|
||||
void AddObjectHelper(CellCoord &cell, GameObjectMapType &m, uint32 &count, Map* map, GameObject *obj)
|
||||
void AddObjectHelper(CellCoord& cell, GameObjectMapType& m, uint32& count, Map* map, GameObject* obj)
|
||||
{
|
||||
obj->AddToGrid(m);
|
||||
ObjectGridLoader::SetObjectCell(obj, cell);
|
||||
@@ -88,7 +88,7 @@ void AddObjectHelper(CellCoord &cell, GameObjectMapType &m, uint32 &count, Map*
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void LoadHelper(CellGuidSet const& guid_set, CellCoord &cell, GridRefManager<T> &m, uint32 &count, Map* map)
|
||||
void LoadHelper(CellGuidSet const& guid_set, CellCoord& cell, GridRefManager<T>& m, uint32& count, Map* map)
|
||||
{
|
||||
for (CellGuidSet::const_iterator i_guid = guid_set.begin(); i_guid != guid_set.end(); ++i_guid)
|
||||
{
|
||||
@@ -106,7 +106,7 @@ void LoadHelper(CellGuidSet const& guid_set, CellCoord &cell, GridRefManager<T>
|
||||
}
|
||||
|
||||
template <>
|
||||
void LoadHelper(CellGuidSet const& guid_set, CellCoord &cell, GridRefManager<GameObject> &m, uint32 &count, Map* map)
|
||||
void LoadHelper(CellGuidSet const& guid_set, CellCoord& cell, GridRefManager<GameObject>& m, uint32& count, Map* map)
|
||||
{
|
||||
for (CellGuidSet::const_iterator i_guid = guid_set.begin(); i_guid != guid_set.end(); ++i_guid)
|
||||
{
|
||||
@@ -124,7 +124,7 @@ void LoadHelper(CellGuidSet const& guid_set, CellCoord &cell, GridRefManager<Gam
|
||||
}
|
||||
}
|
||||
|
||||
void LoadHelper(CellCorpseSet const& cell_corpses, CellCoord &cell, CorpseMapType &m, uint32 &count, Map* map)
|
||||
void LoadHelper(CellCorpseSet const& cell_corpses, CellCoord& cell, CorpseMapType& m, uint32& count, Map* map)
|
||||
{
|
||||
if (cell_corpses.empty())
|
||||
return;
|
||||
@@ -156,21 +156,21 @@ void LoadHelper(CellCorpseSet const& cell_corpses, CellCoord &cell, CorpseMapTyp
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectGridLoader::Visit(GameObjectMapType &m)
|
||||
void ObjectGridLoader::Visit(GameObjectMapType& m)
|
||||
{
|
||||
CellCoord cellCoord = i_cell.GetCellCoord();
|
||||
CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cellCoord.GetId());
|
||||
LoadHelper(cell_guids.gameobjects, cellCoord, m, i_gameObjects, i_map);
|
||||
}
|
||||
|
||||
void ObjectGridLoader::Visit(CreatureMapType &m)
|
||||
void ObjectGridLoader::Visit(CreatureMapType& m)
|
||||
{
|
||||
CellCoord cellCoord = i_cell.GetCellCoord();
|
||||
CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cellCoord.GetId());
|
||||
LoadHelper(cell_guids.creatures, cellCoord, m, i_creatures, i_map);
|
||||
}
|
||||
|
||||
void ObjectWorldLoader::Visit(CorpseMapType &m)
|
||||
void ObjectWorldLoader::Visit(CorpseMapType& m)
|
||||
{
|
||||
CellCoord cellCoord = i_cell.GetCellCoord();
|
||||
// corpses are always added to spawn mode 0 and they are spawned by their instance id
|
||||
@@ -180,12 +180,14 @@ void ObjectWorldLoader::Visit(CorpseMapType &m)
|
||||
|
||||
void ObjectGridLoader::LoadN(void)
|
||||
{
|
||||
i_gameObjects = 0; i_creatures = 0; i_corpses = 0;
|
||||
i_gameObjects = 0;
|
||||
i_creatures = 0;
|
||||
i_corpses = 0;
|
||||
i_cell.data.Part.cell_y = 0;
|
||||
for (unsigned int x=0; x < MAX_NUMBER_OF_CELLS; ++x)
|
||||
for (unsigned int x = 0; x < MAX_NUMBER_OF_CELLS; ++x)
|
||||
{
|
||||
i_cell.data.Part.cell_x = x;
|
||||
for (unsigned int y=0; y < MAX_NUMBER_OF_CELLS; ++y)
|
||||
for (unsigned int y = 0; y < MAX_NUMBER_OF_CELLS; ++y)
|
||||
{
|
||||
i_cell.data.Part.cell_y = y;
|
||||
|
||||
@@ -210,11 +212,11 @@ void ObjectGridLoader::LoadN(void)
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void ObjectGridUnloader::Visit(GridRefManager<T> &m)
|
||||
void ObjectGridUnloader::Visit(GridRefManager<T>& m)
|
||||
{
|
||||
while (!m.isEmpty())
|
||||
{
|
||||
T *obj = m.getFirst()->GetSource();
|
||||
T* obj = m.getFirst()->GetSource();
|
||||
// if option set then object already saved at this moment
|
||||
//if (!sWorld->getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY))
|
||||
// obj->SaveRespawnTime();
|
||||
@@ -229,17 +231,17 @@ void ObjectGridUnloader::Visit(GridRefManager<T> &m)
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void ObjectGridCleaner::Visit(GridRefManager<T> &m)
|
||||
void ObjectGridCleaner::Visit(GridRefManager<T>& m)
|
||||
{
|
||||
for (typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
iter->GetSource()->CleanupsBeforeDelete();
|
||||
}
|
||||
|
||||
template void ObjectGridUnloader::Visit(CreatureMapType &);
|
||||
template void ObjectGridUnloader::Visit(GameObjectMapType &);
|
||||
template void ObjectGridUnloader::Visit(DynamicObjectMapType &);
|
||||
template void ObjectGridUnloader::Visit(CorpseMapType &);
|
||||
template void ObjectGridCleaner::Visit(CreatureMapType &);
|
||||
template void ObjectGridCleaner::Visit<GameObject>(GameObjectMapType &);
|
||||
template void ObjectGridCleaner::Visit<DynamicObject>(DynamicObjectMapType &);
|
||||
template void ObjectGridCleaner::Visit<Corpse>(CorpseMapType &);
|
||||
template void ObjectGridUnloader::Visit(CreatureMapType&);
|
||||
template void ObjectGridUnloader::Visit(GameObjectMapType&);
|
||||
template void ObjectGridUnloader::Visit(DynamicObjectMapType&);
|
||||
template void ObjectGridUnloader::Visit(CorpseMapType&);
|
||||
template void ObjectGridCleaner::Visit(CreatureMapType&);
|
||||
template void ObjectGridCleaner::Visit<GameObject>(GameObjectMapType&);
|
||||
template void ObjectGridCleaner::Visit<DynamicObject>(DynamicObjectMapType&);
|
||||
template void ObjectGridCleaner::Visit<Corpse>(CorpseMapType&);
|
||||
|
||||
@@ -19,40 +19,40 @@ class ObjectGridLoader
|
||||
{
|
||||
friend class ObjectWorldLoader;
|
||||
|
||||
public:
|
||||
ObjectGridLoader(NGridType &grid, Map* map, const Cell &cell)
|
||||
: i_cell(cell), i_grid(grid), i_map(map), i_gameObjects(0), i_creatures(0), i_corpses (0)
|
||||
{}
|
||||
public:
|
||||
ObjectGridLoader(NGridType& grid, Map* map, const Cell& cell)
|
||||
: i_cell(cell), i_grid(grid), i_map(map), i_gameObjects(0), i_creatures(0), i_corpses (0)
|
||||
{}
|
||||
|
||||
void Visit(GameObjectMapType &m);
|
||||
void Visit(CreatureMapType &m);
|
||||
void Visit(CorpseMapType &) const {}
|
||||
void Visit(DynamicObjectMapType&) const {}
|
||||
void Visit(GameObjectMapType& m);
|
||||
void Visit(CreatureMapType& m);
|
||||
void Visit(CorpseMapType&) const {}
|
||||
void Visit(DynamicObjectMapType&) const {}
|
||||
|
||||
void LoadN(void);
|
||||
void LoadN(void);
|
||||
|
||||
template<class T> static void SetObjectCell(T* obj, CellCoord const& cellCoord);
|
||||
template<class T> static void SetObjectCell(T* obj, CellCoord const& cellCoord);
|
||||
|
||||
private:
|
||||
Cell i_cell;
|
||||
NGridType &i_grid;
|
||||
Map* i_map;
|
||||
uint32 i_gameObjects;
|
||||
uint32 i_creatures;
|
||||
uint32 i_corpses;
|
||||
private:
|
||||
Cell i_cell;
|
||||
NGridType& i_grid;
|
||||
Map* i_map;
|
||||
uint32 i_gameObjects;
|
||||
uint32 i_creatures;
|
||||
uint32 i_corpses;
|
||||
};
|
||||
|
||||
//Clean up and remove from world
|
||||
class ObjectGridCleaner
|
||||
{
|
||||
public:
|
||||
template<class T> void Visit(GridRefManager<T> &);
|
||||
public:
|
||||
template<class T> void Visit(GridRefManager<T>&);
|
||||
};
|
||||
|
||||
//Delete objects before deleting NGrid
|
||||
class ObjectGridUnloader
|
||||
{
|
||||
public:
|
||||
template<class T> void Visit(GridRefManager<T> &m);
|
||||
public:
|
||||
template<class T> void Visit(GridRefManager<T>& m);
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user