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

#include "GridNotifiers.h"

Public Member Functions

 NearestGameObjectTypeInObjectRangeCheck (WorldObject const &obj, GameobjectTypes type, float range)
 
bool operator() (GameObject *go)
 

Private Member Functions

 NearestGameObjectTypeInObjectRangeCheck (NearestGameObjectTypeInObjectRangeCheck const &)
 

Private Attributes

WorldObject const & i_obj
 
GameobjectTypes i_type
 
float i_range
 

Detailed Description

Constructor & Destructor Documentation

◆ NearestGameObjectTypeInObjectRangeCheck() [1/2]

Acore::NearestGameObjectTypeInObjectRangeCheck::NearestGameObjectTypeInObjectRangeCheck ( WorldObject const &  obj,
GameobjectTypes  type,
float  range 
)
inline
750: i_obj(obj), i_type(type), i_range(range) {}
float i_range
Definition: GridNotifiers.h:763
GameobjectTypes i_type
Definition: GridNotifiers.h:762
WorldObject const & i_obj
Definition: GridNotifiers.h:761

◆ NearestGameObjectTypeInObjectRangeCheck() [2/2]

Acore::NearestGameObjectTypeInObjectRangeCheck::NearestGameObjectTypeInObjectRangeCheck ( NearestGameObjectTypeInObjectRangeCheck const &  )
private

Member Function Documentation

◆ operator()()

bool Acore::NearestGameObjectTypeInObjectRangeCheck::operator() ( GameObject go)
inline
752 {
753 if (go->GetGoType() == i_type && i_obj.IsWithinDistInMap(go, i_range))
754 {
755 i_range = i_obj.GetDistance(go); // use found GO range as new range limit for next check
756 return true;
757 }
758 return false;
759 }
GameobjectTypes GetGoType() const
Definition: GameObject.h:205
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(), GameObject::GetGoType(), i_obj, i_range, i_type, and WorldObject::IsWithinDistInMap().

Member Data Documentation

◆ i_obj

WorldObject const& Acore::NearestGameObjectTypeInObjectRangeCheck::i_obj
private

Referenced by operator()().

◆ i_range

float Acore::NearestGameObjectTypeInObjectRangeCheck::i_range
private

Referenced by operator()().

◆ i_type

GameobjectTypes Acore::NearestGameObjectTypeInObjectRangeCheck::i_type
private

Referenced by operator()().