TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SpellImplicitTargetInfo Class Reference

#include <SpellInfo.h>

Classes

struct  StaticData
 

Public Member Functions

 SpellImplicitTargetInfo ()
 
 SpellImplicitTargetInfo (uint32 target)
 
bool IsArea () const
 
SpellTargetSelectionCategories GetSelectionCategory () const
 
SpellTargetReferenceTypes GetReferenceType () const
 
SpellTargetObjectTypes GetObjectType () const
 
SpellTargetCheckTypes GetCheckType () const
 
SpellTargetDirectionTypes GetDirectionType () const
 
float CalcDirectionAngle () const
 
Targets GetTarget () const
 
uint32 GetExplicitTargetMask (bool &srcSet, bool &dstSet) const
 

Private Attributes

Targets _target
 

Static Private Attributes

static StaticData _data [TOTAL_SPELL_TARGETS]
 

Constructor & Destructor Documentation

SpellImplicitTargetInfo::SpellImplicitTargetInfo ( )
inline
212 : _target(Targets(0)) { }
Targets
Definition: SharedDefines.h:1873
Targets _target
Definition: SpellInfo.h:210
SpellImplicitTargetInfo::SpellImplicitTargetInfo ( uint32  target)
60 {
61  _target = Targets(target);
62 }
Targets
Definition: SharedDefines.h:1873
Targets _target
Definition: SpellInfo.h:210

Member Function Documentation

float SpellImplicitTargetInfo::CalcDirectionAngle ( ) const
95 {
96  switch (GetDirectionType())
97  {
98  case TARGET_DIR_FRONT:
99  return 0.0f;
100  case TARGET_DIR_BACK:
101  return static_cast<float>(M_PI);
102  case TARGET_DIR_RIGHT:
103  return static_cast<float>(-M_PI/2);
104  case TARGET_DIR_LEFT:
105  return static_cast<float>(M_PI/2);
107  return static_cast<float>(-M_PI/4);
109  return static_cast<float>(-3*M_PI/4);
111  return static_cast<float>(3*M_PI/4);
113  return static_cast<float>(M_PI/4);
114  case TARGET_DIR_RANDOM:
115  return float(rand_norm())*static_cast<float>(2*M_PI);
116  default:
117  return 0.0f;
118  }
119 }
#define M_PI
Definition: Common.h:163
SpellTargetDirectionTypes GetDirectionType() const
Definition: SpellInfo.cpp:89
Definition: SpellInfo.h:137
Definition: SpellInfo.h:138
Definition: SpellInfo.h:133
Definition: SpellInfo.h:135
Definition: SpellInfo.h:134
Definition: SpellInfo.h:139
Definition: SpellInfo.h:140
double rand_norm()
Definition: Random.cpp:69
Definition: SpellInfo.h:136
Definition: SpellInfo.h:141

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

SpellTargetCheckTypes SpellImplicitTargetInfo::GetCheckType ( ) const
85 {
87 }
static StaticData _data[TOTAL_SPELL_TARGETS]
Definition: SpellInfo.h:235
Targets _target
Definition: SpellInfo.h:210
SpellTargetCheckTypes SelectionCheckType
Definition: SpellInfo.h:232

+ Here is the caller graph for this function:

SpellTargetDirectionTypes SpellImplicitTargetInfo::GetDirectionType ( ) const
90 {
91  return _data[_target].DirectionType;
92 }
static StaticData _data[TOTAL_SPELL_TARGETS]
Definition: SpellInfo.h:235
SpellTargetDirectionTypes DirectionType
Definition: SpellInfo.h:233
Targets _target
Definition: SpellInfo.h:210

+ Here is the caller graph for this function:

uint32 SpellImplicitTargetInfo::GetExplicitTargetMask ( bool srcSet,
bool dstSet 
) const
127 {
128  uint32 targetMask = 0;
129  if (GetTarget() == TARGET_DEST_TRAJ)
130  {
131  if (!srcSet)
132  targetMask = TARGET_FLAG_SOURCE_LOCATION;
133  if (!dstSet)
134  targetMask |= TARGET_FLAG_DEST_LOCATION;
135  }
136  else
137  {
138  switch (GetReferenceType())
139  {
141  if (srcSet)
142  break;
143  targetMask = TARGET_FLAG_SOURCE_LOCATION;
144  break;
146  if (dstSet)
147  break;
148  targetMask = TARGET_FLAG_DEST_LOCATION;
149  break;
151  switch (GetObjectType())
152  {
154  targetMask = TARGET_FLAG_GAMEOBJECT;
155  break;
157  targetMask = TARGET_FLAG_GAMEOBJECT_ITEM;
158  break;
162  switch (GetCheckType())
163  {
164  case TARGET_CHECK_ENEMY:
165  targetMask = TARGET_FLAG_UNIT_ENEMY;
166  break;
167  case TARGET_CHECK_ALLY:
168  targetMask = TARGET_FLAG_UNIT_ALLY;
169  break;
170  case TARGET_CHECK_PARTY:
171  targetMask = TARGET_FLAG_UNIT_PARTY;
172  break;
173  case TARGET_CHECK_RAID:
174  targetMask = TARGET_FLAG_UNIT_RAID;
175  break;
177  targetMask = TARGET_FLAG_UNIT_PASSENGER;
178  break;
180  // nobreak;
181  default:
182  targetMask = TARGET_FLAG_UNIT;
183  break;
184  }
185  break;
186  default:
187  break;
188  }
189  break;
190  default:
191  break;
192  }
193  }
194 
195  switch (GetObjectType())
196  {
198  srcSet = true;
199  break;
202  dstSet = true;
203  break;
204  default:
205  break;
206  }
207  return targetMask;
208 }
Definition: SpellInfo.h:49
Definition: SpellInfo.h:110
SpellTargetReferenceTypes GetReferenceType() const
Definition: SpellInfo.cpp:74
Definition: SpellInfo.h:99
Definition: SpellInfo.h:126
Definition: SpellInfo.h:68
Definition: SpellInfo.h:96
Definition: SpellInfo.h:56
Definition: SpellInfo.h:122
Definition: SpellInfo.h:53
Definition: SpellInfo.h:109
Definition: SpellInfo.h:107
Definition: SpellInfo.h:123
Definition: SpellInfo.h:108
Definition: SharedDefines.h:1958
Definition: SpellInfo.h:124
Definition: SpellInfo.h:50
Targets GetTarget() const
Definition: SpellInfo.cpp:121
Definition: SpellInfo.h:51
Definition: SpellInfo.h:55
uint32_t uint32
Definition: Define.h:150
Definition: SpellInfo.h:125
Definition: SpellInfo.h:62
Definition: SpellInfo.h:54
SpellTargetCheckTypes GetCheckType() const
Definition: SpellInfo.cpp:84
Definition: SpellInfo.h:127
SpellTargetObjectTypes GetObjectType() const
Definition: SpellInfo.cpp:79
Definition: SpellInfo.h:106
Definition: SpellInfo.h:59
Definition: SpellInfo.h:98
Definition: SpellInfo.h:105

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

SpellTargetObjectTypes SpellImplicitTargetInfo::GetObjectType ( ) const
80 {
81  return _data[_target].ObjectType;
82 }
static StaticData _data[TOTAL_SPELL_TARGETS]
Definition: SpellInfo.h:235
Targets _target
Definition: SpellInfo.h:210
SpellTargetObjectTypes ObjectType
Definition: SpellInfo.h:229

+ Here is the caller graph for this function:

SpellTargetReferenceTypes SpellImplicitTargetInfo::GetReferenceType ( ) const
75 {
76  return _data[_target].ReferenceType;
77 }
static StaticData _data[TOTAL_SPELL_TARGETS]
Definition: SpellInfo.h:235
Targets _target
Definition: SpellInfo.h:210
SpellTargetReferenceTypes ReferenceType
Definition: SpellInfo.h:230

+ Here is the caller graph for this function:

SpellTargetSelectionCategories SpellImplicitTargetInfo::GetSelectionCategory ( ) const
70 {
72 }
static StaticData _data[TOTAL_SPELL_TARGETS]
Definition: SpellInfo.h:235
Targets _target
Definition: SpellInfo.h:210
SpellTargetSelectionCategories SelectionCategory
Definition: SpellInfo.h:231

+ Here is the caller graph for this function:

Targets SpellImplicitTargetInfo::GetTarget ( ) const
122 {
123  return _target;
124 }
Targets _target
Definition: SpellInfo.h:210

+ Here is the caller graph for this function:

bool SpellImplicitTargetInfo::IsArea ( ) const
65 {
67 }
SpellTargetSelectionCategories GetSelectionCategory() const
Definition: SpellInfo.cpp:69
Definition: SpellInfo.h:88
Definition: SpellInfo.h:89

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

SpellImplicitTargetInfo::StaticData SpellImplicitTargetInfo::_data
staticprivate
Targets SpellImplicitTargetInfo::_target
private

The documentation for this class was generated from the following files: