TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
RemovalState Class Reference

#include <GridStates.h>

Public Member Functions

void Update (Map &, NGridType &, GridInfo &, uint32 t_diff) const override
 
- Public Member Functions inherited from GridState
virtual ~GridState ()
 

Member Function Documentation

void RemovalState::Update ( Map map,
NGridType grid,
GridInfo info,
uint32  t_diff 
) const
overridevirtual

Implements GridState.

53 {
54  if (!info.getUnloadLock())
55  {
56  info.UpdateTimeTracker(diff);
57  if (info.getTimeTracker().Passed() && !map.UnloadGrid(grid, false))
58  {
59  TC_LOG_DEBUG("maps", "Grid[%u, %u] for map %u differed unloading due to players or active objects nearby", grid.getX(), grid.getY(), map.GetId());
60  map.ResetGridExpiry(grid);
61  }
62  }
63 }
void UpdateTimeTracker(time_t diff)
Definition: NGrid.h:50
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
uint32 GetId(void) const
Definition: Map.h:325
const TimeTracker & getTimeTracker() const
Definition: NGrid.h:41
bool UnloadGrid(NGridType &ngrid, bool pForce)
Definition: Map.cpp:1518
int32 getY() const
Definition: NGrid.h:103
bool getUnloadLock() const
Definition: NGrid.h:42
int32 getX() const
Definition: NGrid.h:102
bool Passed() const
Definition: Timer.h:114
void ResetGridExpiry(NGridType &grid, float factor=1) const
Definition: Map.h:319

+ Here is the call graph for this function:


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