TrinityCore
UnitAI.h File Reference
#include "Containers.h"
#include "Errors.h"
#include "ObjectGuid.h"
#include "SpellDefines.h"
#include "ThreatManager.h"
#include <unordered_map>
+ Include dependency graph for UnitAI.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  DefaultTargetSelector
 
struct  SpellTargetSelector
 
struct  NonTankTargetSelector
 
struct  PowerUsersSelector
 
struct  FarthestTargetSelector
 
class  UnitAI
 

Macros

#define CAST_AI(a, b)   (dynamic_cast<a*>(b))
 
#define ENSURE_AI(a, b)   (EnsureAI<a>(b))
 

Enumerations

enum  SelectTargetMethod {
  SelectTargetMethod::Random, SelectTargetMethod::MaxThreat, SelectTargetMethod::MinThreat, SelectTargetMethod::MaxDistance,
  SelectTargetMethod::MinDistance
}
 

Functions

template<class T , class U >
T * EnsureAI (U *ai)
 

Macro Definition Documentation

◆ CAST_AI

#define CAST_AI (   a,
 
)    (dynamic_cast<a*>(b))

◆ ENSURE_AI

#define ENSURE_AI (   a,
 
)    (EnsureAI<a>(b))

Enumeration Type Documentation

◆ SelectTargetMethod

enum SelectTargetMethod
strong
Enumerator
Random 
MaxThreat 
MinThreat 
MaxDistance 
MinDistance 
51 {
52  Random, // just pick a random target
53  MaxThreat, // prefer targets higher in the threat list
54  MinThreat, // prefer targets lower in the threat list
55  MaxDistance, // prefer targets further from us
56  MinDistance // prefer targets closer to us
57 };

Function Documentation

◆ EnsureAI()

template<class T , class U >
T* EnsureAI ( U *  ai)
33 {
34  T* cast_ai = dynamic_cast<T*>(ai);
35  ASSERT(cast_ai);
36  return cast_ai;
37 }
#define ASSERT
Definition: Errors.h:68