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
724 :
725 i_obj(obj), i_entry(entry), i_range(range), i_onlySpawned(onlySpawned) { }
WorldObject const & i_obj
Definition: GridNotifiers.h:737
bool i_onlySpawned
Definition: GridNotifiers.h:740
uint32 i_entry
Definition: GridNotifiers.h:738
float i_range
Definition: GridNotifiers.h:739

◆ NearestGameObjectEntryInObjectRangeCheck() [2/2]

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

Member Function Documentation

◆ operator()()

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

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()().