TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Trinity::DelayedUnitRelocation Struct Reference

#include <GridNotifiers.h>

Public Member Functions

 DelayedUnitRelocation (Cell &c, CellCoord &pair, Map &map, float radius)
 
template<class T >
void Visit (GridRefManager< T > &)
 
void Visit (CreatureMapType &)
 
void Visit (PlayerMapType &)
 

Public Attributes

Mapi_map
 
Cellcell
 
CellCoordp
 
const float i_radius
 

Constructor & Destructor Documentation

Trinity::DelayedUnitRelocation::DelayedUnitRelocation ( Cell c,
CellCoord pair,
Map map,
float  radius 
)
inline
90  :
91  i_map(map), cell(c), p(pair), i_radius(radius) { }
Map & i_map
Definition: GridNotifiers.h:86
Cell & cell
Definition: GridNotifiers.h:87
const float i_radius
Definition: GridNotifiers.h:89
CellCoord & p
Definition: GridNotifiers.h:88

Member Function Documentation

template<class T >
void Trinity::DelayedUnitRelocation::Visit ( GridRefManager< T > &  )
inline
92 { }
void DelayedUnitRelocation::Visit ( CreatureMapType m)
207 {
208  for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
209  {
210  Creature* unit = iter->GetSource();
212  continue;
213 
214  CreatureRelocationNotifier relocate(*unit);
215 
218 
219  cell.Visit(p, c2world_relocation, i_map, *unit, i_radius);
220  cell.Visit(p, c2grid_relocation, i_map, *unit, i_radius);
221  }
222 }
Definition: Object.h:74
Definition: TypeContainerVisitor.h:32
Definition: GridNotifiers.h:75
Map & i_map
Definition: GridNotifiers.h:86
bool isNeedNotify(uint16 f) const
Definition: Object.h:575
Definition: Creature.h:467
Cell & cell
Definition: GridNotifiers.h:87
const float i_radius
Definition: GridNotifiers.h:89
Definition: LinkedList.h:141
iterator begin()
Definition: GridRefManager.h:36
iterator end()
Definition: GridRefManager.h:37
CellCoord & p
Definition: GridNotifiers.h:88
void Visit(CellCoord const &, TypeContainerVisitor< T, CONTAINER > &visitor, Map &, WorldObject const &, float) const
Definition: CellImpl.h:122

+ Here is the call graph for this function:

void DelayedUnitRelocation::Visit ( PlayerMapType m)
225 {
226  for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
227  {
228  Player* player = iter->GetSource();
229  WorldObject const* viewPoint = player->m_seer;
230 
231  if (!viewPoint->isNeedNotify(NOTIFY_VISIBILITY_CHANGED))
232  continue;
233 
234  if (player != viewPoint && !viewPoint->IsPositionValid())
235  continue;
236 
237  CellCoord pair2(Trinity::ComputeCellCoord(viewPoint->GetPositionX(), viewPoint->GetPositionY()));
238  Cell cell2(pair2);
239  //cell.SetNoCreate(); need load cells around viewPoint or player, that's why its commented
240 
241  PlayerRelocationNotifier relocate(*player);
244 
245  cell2.Visit(pair2, c2world_relocation, i_map, *viewPoint, i_radius);
246  cell2.Visit(pair2, c2grid_relocation, i_map, *viewPoint, i_radius);
247 
248  relocate.SendToSelf();
249  }
250 }
Definition: Object.h:74
Definition: TypeContainerVisitor.h:32
Definition: GridNotifiers.h:66
Map & i_map
Definition: GridNotifiers.h:86
CellCoord ComputeCellCoord(float x, float y)
Definition: GridDefines.h:193
bool isNeedNotify(uint16 f) const
Definition: Object.h:575
Definition: Object.h:423
const float i_radius
Definition: GridNotifiers.h:89
float GetPositionY() const
Definition: Position.h:105
Definition: LinkedList.h:141
iterator begin()
Definition: GridRefManager.h:36
Definition: Cell.h:49
bool IsPositionValid() const
Definition: Position.cpp:40
iterator end()
Definition: GridRefManager.h:37
float GetPositionX() const
Definition: Position.h:104

+ Here is the call graph for this function:

Member Data Documentation

Cell& Trinity::DelayedUnitRelocation::cell
Map& Trinity::DelayedUnitRelocation::i_map
const float Trinity::DelayedUnitRelocation::i_radius
CellCoord& Trinity::DelayedUnitRelocation::p

The documentation for this struct was generated from the following files: