OregonCore  revision be9e804-git
Your Favourite TBC server
Oregon Namespace Reference

Namespaces

 Honor
 
 XP
 

Classes

class  _Callback
 
class  _Callback< Class >
 
class  _Callback< Class, ParamType1 >
 
class  _Callback< Class, ParamType1, ParamType2 >
 
class  _Callback< Class, ParamType1, ParamType2, ParamType3 >
 
class  _ICallback
 
class  _IQueryCallback
 
class  _SCallback
 
class  _SCallback< >
 
class  _SCallback< ParamType1 >
 
class  _SCallback< ParamType1, ParamType2 >
 
class  _SCallback< ParamType1, ParamType2, ParamType3 >
 
struct  AIRelocationNotifier
 
class  AllCreaturesOfEntryInRange
 
class  AllFriendlyCreaturesInGrid
 
class  AllGameObjectsWithEntryInRange
 
class  AllWorldObjectsInRange
 
class  AnyAoETargetUnitInObjectRangeCheck
 
class  AnyAssistCreatureInRangeCheck
 
struct  AnyDeadUnitCheck
 
class  AnyFriendlyUnitInObjectRangeCheck
 
class  AnyPlayerInObjectRangeCheck
 
class  AnyUnfriendlyNoTotemUnitInObjectRangeCheck
 
class  AnyUnfriendlyUnitInObjectRangeCheck
 
class  AnyUnitInObjectRangeCheck
 
class  Battleground2ChatBuilder
 
class  BattlegroundChatBuilder
 
class  Callback
 
class  Callback< Class >
 
class  Callback< Class, ParamType1 >
 
class  Callback< Class, ParamType1, ParamType2 >
 
class  Callback< Class, ParamType1, ParamType2, ParamType3 >
 
class  CallOfHelpCreatureInRangeDo
 
class  CannibalizeObjectCheck
 
class  ClassLevelLockable
 
class  CreateOnCallBack
 
class  CreateUsingMalloc
 
struct  CreatureLastSearcher
 
struct  CreatureListSearcher
 
struct  CreatureRelocationNotifier
 
struct  CreatureSearcher
 
class  CreatureWithDbGUIDCheck
 
struct  CreatureWorker
 
struct  DelayedUnitRelocation
 
struct  DynamicObjectUpdater
 
class  FriendlyCCedInRange
 
class  FriendlyMissingBuffInRange
 
class  GameObjectFocusCheck
 
struct  GameObjectLastSearcher
 
struct  GameObjectListSearcher
 
struct  GameObjectSearcher
 
class  GameObjectWithDbGUIDCheck
 
class  GeneralLock
 
struct  GridUpdater
 
class  ICallback
 
class  IQueryCallback
 
class  LocalizedPacketDo
 
class  LocalizedPacketListDo
 
class  LocalStaticCreation
 
struct  MessageDistDeliverer
 
class  MonsterChatBuilder
 
class  MostHPMissingInRange
 
class  NearestAssistCreatureInCreatureRangeCheck
 
class  NearestAttackableUnitInObjectRangeCheck
 
class  NearestCreatureEntryWithLiveStateInObjectRangeCheck
 
class  NearestGameObjectEntryInObjectRangeCheck
 
class  NearestGameObjectFishingHole
 
class  NearestGameObjectTypeInObjectRangeCheck
 
class  NearestHostileUnitCheck
 
class  NearestHostileUnitInAggroRangeCheck
 
class  NearestHostileUnitInAttackDistanceCheck
 
class  NearestPlayerInObjectRangeCheck
 
class  ObjectDistanceOrderPred
 
class  ObjectLevelLockable
 
class  ObjectLifeTime
 
class  ObjectTypeIdCheck
 
struct  ObjectUpdater
 
class  OperatorNew
 
class  PlayerAtMinimumRangeAway
 
struct  PlayerDistWorker
 
struct  PlayerListSearcher
 
struct  PlayerRelocationNotifier
 
struct  PlayerSearcher
 
struct  PlayerWorker
 
class  QueryCallback
 
class  QueryCallback< Class >
 
class  QueryCallback< Class, ParamType1 >
 
class  QueryCallback< Class, ParamType1, ParamType2 >
 
class  RespawnDo
 
class  SingleThreaded
 
class  Singleton
 
struct  SpellNotifierCreatureAndPlayer
 
class  SQueryCallback
 
class  SQueryCallback< >
 
class  SQueryCallback< ParamType1 >
 
class  SQueryCallback< ParamType1, ParamType2 >
 
class  ThreatOrderPred
 
struct  UnitLastSearcher
 
struct  UnitListSearcher
 
struct  UnitSearcher
 
struct  VisibleChangesNotifier
 
struct  VisibleNotifier
 
struct  WorldObjectListSearcher
 
struct  WorldObjectSearcher
 
struct  WorldObjectWorker
 

Functions

template<class SPECIFIC_TYPE >
size_t Count (const ContainerMapList< SPECIFIC_TYPE > &elements, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE >
size_t Count (const ContainerMapList< TypeNull > &, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class T >
size_t Count (const ContainerMapList< T > &, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class T >
size_t Count (const ContainerMapList< TypeList< SPECIFIC_TYPE, T > > &elements, SPECIFIC_TYPE *fake)
 
template<class SPECIFIC_TYPE , class H , class T >
size_t Count (const ContainerMapList< TypeList< H, T > > &elements, SPECIFIC_TYPE *fake)
 
template<class SPECIFIC_TYPE >
SPECIFIC_TYPE * Insert (ContainerMapList< SPECIFIC_TYPE > &elements, SPECIFIC_TYPE *obj)
 
template<class SPECIFIC_TYPE >
SPECIFIC_TYPE * Insert (ContainerMapList< TypeNull > &, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class T >
SPECIFIC_TYPE * Insert (ContainerMapList< T > &, SPECIFIC_TYPE *)
 
template<class SPECIFIC_TYPE , class H , class T >
SPECIFIC_TYPE * Insert (ContainerMapList< TypeList< H, T > > &elements, SPECIFIC_TYPE *obj)
 
void external_wrapper (void *p)
 
void at_exit (void(*func)())
 
void Guard (void *)
 
template<class RET_TYPE , int CENTER_VAL>
RET_TYPE Compute (float x, float y, float center_offset, float size)
 
GridCoord ComputeGridCoord (float x, float y)
 
CellCoord ComputeCellCoord (float x, float y)
 
CellCoord ComputeCellCoord (float x, float y, float &x_off, float &y_off)
 
void NormalizeMapCoord (float &c)
 
bool IsValidMapCoord (float c)
 
bool IsValidMapCoord (float x, float y)
 
bool IsValidMapCoord (float x, float y, float z)
 
bool IsValidMapCoord (float x, float y, float z, float o)
 
template<class T >
void RandomResizeList (std::list< T > &_list, uint32 _size)
 

Function Documentation

void Oregon::at_exit ( void(*)()  func)

Definition at line 28 of file ObjectLifeTime.cpp.

References external_wrapper().

Referenced by Oregon::ObjectLifeTime< T >::ScheduleCall().

29 {
30  external_wrapper((void*)func);
31 }
void external_wrapper(void *p)
template<class RET_TYPE , int CENTER_VAL>
RET_TYPE Oregon::Compute ( float  x,
float  y,
float  center_offset,
float  size 
)
inline

Definition at line 151 of file GridDefines.h.

152 {
153  // calculate and store temporary values in double format for having same result as same mySQL calculations
154  double x_offset = (double(x) - center_offset) / size;
155  double y_offset = (double(y) - center_offset) / size;
156 
157  int x_val = int(x_offset + CENTER_VAL + 0.5);
158  int y_val = int(y_offset + CENTER_VAL + 0.5);
159  return RET_TYPE(x_val, y_val);
160 }
CellCoord Oregon::ComputeCellCoord ( float  x,
float  y 
)
inline

Definition at line 167 of file GridDefines.h.

References CENTER_GRID_CELL_OFFSET, and SIZE_OF_GRID_CELL.

Referenced by Map::_FindGameObject(), Map::ActiveObjectsNearGrid(), ObjectAccessor::AddCorpse(), ObjectMgr::AddCreatureToGrid(), ObjectMgr::AddGameobjectToGrid(), Map::AddPlayerToMap(), Map::AddToMap(), WorldObject::BuildUpdate(), Cell::CalculateCellArea(), Creature::CallAssistance(), Creature::CallForHelp(), Cell::Cell(), Spell::CheckCast(), Spell::CheckItems(), SmartScript::DoFindFriendlyCC(), CreatureEventAI::DoFindFriendlyCC(), SmartScript::DoFindFriendlyMissingBuff(), CreatureEventAI::DoFindFriendlyMissingBuff(), Creature::DoFleeToGetAssistance(), SmartScript::DoSelectLowestHpFriendly(), CreatureEventAI::DoSelectLowestHpFriendly(), SmartScript::FindCreatureNear(), SmartScript::FindGameObjectNear(), WorldObject::GetCreatureListWithEntryInGrid(), WorldObject::GetGameObjectListWithEntryInGrid(), ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(), ObjectAccessor::GetObjectInWorld(), ScriptedAI::GetPlayerAtMinimumRange(), ChatHandler::HandleGPSCommand(), ChatHandler::HandleRespawnCommand(), GameObject::LookupFishingHoleAround(), WorldObject::MonsterSay(), WorldObject::MonsterTextEmote(), WorldObject::MonsterYell(), Map::MoveAllCreaturesInMoveList(), ObjectAccessor::RemoveCorpse(), ObjectMgr::RemoveCreatureFromGrid(), ObjectMgr::RemoveGameobjectFromGrid(), Map::ScriptsProcess(), Unit::SelectNearestPlayer(), Creature::SelectNearestTarget(), Creature::SelectNearestTargetInAttackDistance(), Map::SwitchGridContainers(), GameObject::TriggeringLinkedGameObject(), ObjectGridEvacuator::Visit(), Oregon::DelayedUnitRelocation::Visit(), Map::VisitAll(), Map::VisitGrid(), and Map::VisitWorld().

168 {
169  return Compute<CellCoord, CENTER_GRID_CELL_ID>(x, y, CENTER_GRID_CELL_OFFSET, SIZE_OF_GRID_CELL);
170 }
#define SIZE_OF_GRID_CELL
Definition: GridDefines.h:44
#define CENTER_GRID_CELL_OFFSET
Definition: GridDefines.h:47
CellCoord Oregon::ComputeCellCoord ( float  x,
float  y,
float &  x_off,
float &  y_off 
)
inline

Definition at line 172 of file GridDefines.h.

References CENTER_GRID_CELL_ID, CENTER_GRID_CELL_OFFSET, and SIZE_OF_GRID_CELL.

173 {
174  double x_offset = (double(x) - CENTER_GRID_CELL_OFFSET) / SIZE_OF_GRID_CELL;
175  double y_offset = (double(y) - CENTER_GRID_CELL_OFFSET) / SIZE_OF_GRID_CELL;
176 
177  int x_val = int(x_offset + CENTER_GRID_CELL_ID + 0.5);
178  int y_val = int(y_offset + CENTER_GRID_CELL_ID + 0.5);
179  x_off = (float(x_offset) - x_val + CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL;
180  y_off = (float(y_offset) - y_val + CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL;
181  return CellCoord(x_val, y_val);
182 }
#define CENTER_GRID_CELL_ID
Definition: GridDefines.h:46
#define SIZE_OF_GRID_CELL
Definition: GridDefines.h:44
#define CENTER_GRID_CELL_OFFSET
Definition: GridDefines.h:47
CoordPair< TOTAL_NUMBER_OF_CELLS_PER_MAP > CellCoord
Definition: GridDefines.h:146
GridCoord Oregon::ComputeGridCoord ( float  x,
float  y 
)
inline

Definition at line 162 of file GridDefines.h.

References CENTER_GRID_OFFSET, and SIZE_OF_GRIDS.

Referenced by Map::AddToActive(), Corpse::Create(), MapManager::ExistMapAndVMap(), ChatHandler::HandleGPSCommand(), Map::IsGridLoaded(), Map::IsRemovalGrid(), Corpse::LoadCorpseFromDB(), and Map::RemoveFromActive().

163 {
164  return Compute<GridCoord, CENTER_GRID_ID>(x, y, CENTER_GRID_OFFSET, SIZE_OF_GRIDS);
165 }
#define SIZE_OF_GRIDS
Definition: GridDefines.h:35
#define CENTER_GRID_OFFSET
Definition: GridDefines.h:38
template<class SPECIFIC_TYPE >
size_t Oregon::Count ( const ContainerMapList< SPECIFIC_TYPE > &  elements,
SPECIFIC_TYPE *   
)
template<class SPECIFIC_TYPE >
size_t Oregon::Count ( const ContainerMapList< TypeNull > &  ,
SPECIFIC_TYPE *   
)

Definition at line 39 of file TypeContainerFunctions.h.

40 {
41  return 0;
42 }
template<class SPECIFIC_TYPE , class T >
size_t Oregon::Count ( const ContainerMapList< T > &  ,
SPECIFIC_TYPE *   
)

Definition at line 44 of file TypeContainerFunctions.h.

45 {
46  return 0;
47 }
template<class SPECIFIC_TYPE , class T >
size_t Oregon::Count ( const ContainerMapList< TypeList< SPECIFIC_TYPE, T > > &  elements,
SPECIFIC_TYPE *  fake 
)

Definition at line 49 of file TypeContainerFunctions.h.

References Count().

50 {
51  return Count(elements._elements, fake);
52 }
size_t Count(const ContainerMapList< TypeList< H, T > > &elements, SPECIFIC_TYPE *fake)
template<class SPECIFIC_TYPE , class H , class T >
size_t Oregon::Count ( const ContainerMapList< TypeList< H, T > > &  elements,
SPECIFIC_TYPE *  fake 
)

Definition at line 54 of file TypeContainerFunctions.h.

References Count().

55 {
56  return Count(elements._TailElements, fake);
57 }
ContainerMapList< T > _TailElements
Definition: TypeContainer.h:49
size_t Count(const ContainerMapList< TypeList< H, T > > &elements, SPECIFIC_TYPE *fake)
void Oregon::external_wrapper ( void *  p)

Definition at line 23 of file ObjectLifeTime.cpp.

Referenced by at_exit().

24 {
25  std::atexit( (void (*)())p );
26 }
template<class SPECIFIC_TYPE >
SPECIFIC_TYPE* Oregon::Insert ( ContainerMapList< SPECIFIC_TYPE > &  elements,
SPECIFIC_TYPE *  obj 
)

Definition at line 60 of file TypeContainerFunctions.h.

References ContainerMapList< OBJECT >::_element.

Referenced by TypeMapContainer< GRID_OBJECT_TYPES >::insert(), and Insert().

61 {
62  //elements._element[hdl] = obj;
63  obj->AddToGrid(elements._element);
64  return obj;
65 };
GridRefManager< OBJECT > _element
Definition: TypeContainer.h:40
template<class SPECIFIC_TYPE >
SPECIFIC_TYPE* Oregon::Insert ( ContainerMapList< TypeNull > &  ,
SPECIFIC_TYPE *   
)

Definition at line 67 of file TypeContainerFunctions.h.

68 {
69  return NULL;
70 }
template<class SPECIFIC_TYPE , class T >
SPECIFIC_TYPE* Oregon::Insert ( ContainerMapList< T > &  ,
SPECIFIC_TYPE *   
)

Definition at line 73 of file TypeContainerFunctions.h.

74 {
75  return NULL; // a missed
76 }
template<class SPECIFIC_TYPE , class H , class T >
SPECIFIC_TYPE* Oregon::Insert ( ContainerMapList< TypeList< H, T > > &  elements,
SPECIFIC_TYPE *  obj 
)

Definition at line 79 of file TypeContainerFunctions.h.

References Insert().

80 {
81  SPECIFIC_TYPE* t = Insert(elements._elements, obj);
82  return (t != NULL ? t : Insert(elements._TailElements, obj));
83 }
SPECIFIC_TYPE * Insert(ContainerMapList< TypeList< H, T > > &elements, SPECIFIC_TYPE *obj)
ContainerMapList< T > _TailElements
Definition: TypeContainer.h:49
bool Oregon::IsValidMapCoord ( float  x,
float  y 
)
inline

Definition at line 197 of file GridDefines.h.

References IsValidMapCoord().

198 {
199  return IsValidMapCoord(x) && IsValidMapCoord(y);
200 }
bool IsValidMapCoord(float x, float y, float z, float o)
Definition: GridDefines.h:207
bool Oregon::IsValidMapCoord ( float  x,
float  y,
float  z 
)
inline

Definition at line 202 of file GridDefines.h.

References finite, and IsValidMapCoord().

203 {
204  return IsValidMapCoord(x, y) && finite(z);
205 }
#define finite(X)
Definition: Common.h:132
bool IsValidMapCoord(float x, float y, float z, float o)
Definition: GridDefines.h:207
bool Oregon::IsValidMapCoord ( float  x,
float  y,
float  z,
float  o 
)
inline

Definition at line 207 of file GridDefines.h.

References finite, and IsValidMapCoord().

208 {
209  return IsValidMapCoord(x, y, z) && finite(o);
210 }
#define finite(X)
Definition: Common.h:132
bool IsValidMapCoord(float x, float y, float z, float o)
Definition: GridDefines.h:207
void Oregon::NormalizeMapCoord ( float &  c)
inline
template<class T >
void Oregon::RandomResizeList ( std::list< T > &  _list,
uint32  _size 
)

Definition at line 2117 of file Unit.h.

References urand().

Referenced by Spell::SetTargetMap().

2118 {
2119  while (_list.size() > _size)
2120  {
2121  typename std::list<T>::iterator itr = _list.begin();
2122  advance(itr, urand(0, _list.size() - 1));
2123  _list.erase(itr);
2124  }
2125 }
uint32 urand(uint32 min, uint32 max)
Definition: Util.cpp:33