AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::NearestGameObjectEntryInObjectRangeCheck Class Reference

#include "GridNotifiers.h"

Public Member Functions

 NearestGameObjectEntryInObjectRangeCheck (WorldObject const &obj, uint32 entry, float range, bool onlySpawned=false)
 
bool operator() (GameObject *go)
 

Private Member Functions

 NearestGameObjectEntryInObjectRangeCheck (NearestGameObjectEntryInObjectRangeCheck const &)
 

Private Attributes

WorldObject const & i_obj
 
uint32 i_entry
 
float i_range
 
bool i_onlySpawned
 

Detailed Description

Constructor & Destructor Documentation

◆ NearestGameObjectEntryInObjectRangeCheck() [1/2]

Acore::NearestGameObjectEntryInObjectRangeCheck::NearestGameObjectEntryInObjectRangeCheck ( WorldObject const &  obj,
uint32  entry,
float  range,
bool  onlySpawned = false 
)
inline
727 :
728 i_obj(obj), i_entry(entry), i_range(range), i_onlySpawned(onlySpawned) { }
WorldObject const & i_obj
Definition: GridNotifiers.h:740
bool i_onlySpawned
Definition: GridNotifiers.h:743
uint32 i_entry
Definition: GridNotifiers.h:741
float i_range
Definition: GridNotifiers.h:742

◆ NearestGameObjectEntryInObjectRangeCheck() [2/2]

Acore::NearestGameObjectEntryInObjectRangeCheck::NearestGameObjectEntryInObjectRangeCheck ( NearestGameObjectEntryInObjectRangeCheck const &  )
private

Member Function Documentation

◆ operator()()

bool Acore::NearestGameObjectEntryInObjectRangeCheck::operator() ( GameObject go)
inline
731 {
732 if (go->GetEntry() == i_entry && i_obj.IsWithinDistInMap(go, i_range) && (!i_onlySpawned || go->isSpawned()))
733 {
734 i_range = i_obj.GetDistance(go); // use found GO range as new range limit for next check
735 return true;
736 }
737 return false;
738 }
bool isSpawned() const
Definition: GameObject.h:189
uint32 GetEntry() const
Definition: Object.h:115
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1332
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1256

References WorldObject::GetDistance(), Object::GetEntry(), i_entry, i_obj, i_onlySpawned, i_range, GameObject::isSpawned(), and WorldObject::IsWithinDistInMap().

Member Data Documentation

◆ i_entry

uint32 Acore::NearestGameObjectEntryInObjectRangeCheck::i_entry
private

Referenced by operator()().

◆ i_obj

WorldObject const& Acore::NearestGameObjectEntryInObjectRangeCheck::i_obj
private

Referenced by operator()().

◆ i_onlySpawned

bool Acore::NearestGameObjectEntryInObjectRangeCheck::i_onlySpawned
private

Referenced by operator()().

◆ i_range

float Acore::NearestGameObjectEntryInObjectRangeCheck::i_range
private

Referenced by operator()().