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
753: i_obj(obj), i_type(type), i_range(range) {}
float i_range
Definition: GridNotifiers.h:766
GameobjectTypes i_type
Definition: GridNotifiers.h:765
WorldObject const & i_obj
Definition: GridNotifiers.h:764

◆ NearestGameObjectTypeInObjectRangeCheck() [2/2]

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

Member Function Documentation

◆ operator()()

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