AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
TestSpellEntryHelper Class Reference

Helper class to create SpellEntry test instances. More...

#include "SpellInfoTestHelper.h"

Public Member Functions

 TestSpellEntryHelper ()
 
TestSpellEntryHelper & WithId (uint32 id)
 
TestSpellEntryHelper & WithSpellFamilyName (uint32 familyName)
 
TestSpellEntryHelper & WithSpellFamilyFlags (uint32 flag0, uint32 flag1=0, uint32 flag2=0)
 
TestSpellEntryHelper & WithSchoolMask (uint32 schoolMask)
 
TestSpellEntryHelper & WithProcFlags (uint32 procFlags)
 
TestSpellEntryHelper & WithProcChance (uint32 procChance)
 
TestSpellEntryHelper & WithProcCharges (uint32 procCharges)
 
TestSpellEntryHelper & WithDmgClass (uint32 dmgClass)
 
TestSpellEntryHelper & WithAttributesEx3 (uint32 attr)
 
TestSpellEntryHelper & WithAttributesEx (uint32 attr)
 
TestSpellEntryHelper & WithEffect (uint8 effIndex, uint32 effect, uint32 auraType=0)
 
TestSpellEntryHelper & WithEffectImplicitTargets (uint8 effIndex, uint32 targetA, uint32 targetB=0)
 
TestSpellEntryHelper & WithEffectTriggerSpell (uint8 effIndex, uint32 triggerSpell)
 
TestSpellEntryHelper & WithEffectBasePoints (uint8 effIndex, int32 basePoints)
 
TestSpellEntryHelper & WithEffectMiscValue (uint8 effIndex, int32 miscValue)
 
TestSpellEntryHelper & WithEffectDieSides (uint8 effIndex, int32 dieSides)
 
TestSpellEntryHelper & WithAttributes (uint32 attr)
 
SpellEntry const * Get () const
 

Private Attributes

SpellEntry _entry {}
 

Detailed Description

Helper class to create SpellEntry test instances.

This creates a SpellEntry with sensible defaults for unit testing.

Constructor & Destructor Documentation

◆ TestSpellEntryHelper()

TestSpellEntryHelper::TestSpellEntryHelper ( )
inline
34 {
35 // Set safe defaults
38
39 // Initialize empty strings
40 for (auto& name : _entry.SpellName)
41 name = "";
42 for (auto& rank : _entry.Rank)
43 rank = "";
44 }
@ SPELL_SCHOOL_MASK_NORMAL
Definition SharedDefines.h:285
SpellEntry _entry
Definition SpellInfoTestHelper.h:170
int32 EquippedItemClass
Definition DBCStructure.h:1730
uint32 SchoolMask
Definition DBCStructure.h:1779

References _entry, SpellEntry::EquippedItemClass, SpellEntry::Rank, SpellEntry::SchoolMask, SPELL_SCHOOL_MASK_NORMAL, and SpellEntry::SpellName.

Member Function Documentation

◆ Get()

SpellEntry const * TestSpellEntryHelper::Get ( ) const
inline
165 {
166 return &_entry;
167 }

References _entry.

Referenced by SpellInfoBuilder::Build(), and SpellInfoBuilder::BuildUnique().

◆ WithAttributes()

TestSpellEntryHelper & TestSpellEntryHelper::WithAttributes ( uint32  attr)
inline
159 {
160 _entry.Attributes = attr;
161 return *this;
162 }
uint32 Attributes
Definition DBCStructure.h:1683

References _entry, and SpellEntry::Attributes.

Referenced by SpellInfoBuilder::WithAttributes().

◆ WithAttributesEx()

TestSpellEntryHelper & TestSpellEntryHelper::WithAttributesEx ( uint32  attr)
inline
103 {
104 _entry.AttributesEx = attr;
105 return *this;
106 }
uint32 AttributesEx
Definition DBCStructure.h:1684

References _entry, and SpellEntry::AttributesEx.

Referenced by SpellInfoBuilder::WithAttributesEx().

◆ WithAttributesEx3()

TestSpellEntryHelper & TestSpellEntryHelper::WithAttributesEx3 ( uint32  attr)
inline
97 {
98 _entry.AttributesEx3 = attr;
99 return *this;
100 }
uint32 AttributesEx3
Definition DBCStructure.h:1686

References _entry, and SpellEntry::AttributesEx3.

Referenced by SpellInfoBuilder::WithAttributesEx3().

◆ WithDmgClass()

TestSpellEntryHelper & TestSpellEntryHelper::WithDmgClass ( uint32  dmgClass)
inline
91 {
92 _entry.DmgClass = dmgClass;
93 return *this;
94 }
uint32 DmgClass
Definition DBCStructure.h:1770

References _entry, and SpellEntry::DmgClass.

Referenced by SpellInfoBuilder::WithDmgClass().

◆ WithEffect()

TestSpellEntryHelper & TestSpellEntryHelper::WithEffect ( uint8  effIndex,
uint32  effect,
uint32  auraType = 0 
)
inline
109 {
110 if (effIndex < MAX_SPELL_EFFECTS)
111 {
112 _entry.Effect[effIndex] = effect;
113 _entry.EffectApplyAuraName[effIndex] = auraType;
114 }
115 return *this;
116 }
#define MAX_SPELL_EFFECTS
Definition DBCStructure.h:1673
std::array< uint32, MAX_SPELL_EFFECTS > EffectApplyAuraName
Definition DBCStructure.h:1741
std::array< uint32, MAX_SPELL_EFFECTS > Effect
Definition DBCStructure.h:1733

References _entry, SpellEntry::Effect, SpellEntry::EffectApplyAuraName, and MAX_SPELL_EFFECTS.

Referenced by SpellInfoBuilder::WithEffect().

◆ WithEffectBasePoints()

TestSpellEntryHelper & TestSpellEntryHelper::WithEffectBasePoints ( uint8  effIndex,
int32  basePoints 
)
inline
138 {
139 if (effIndex < MAX_SPELL_EFFECTS)
140 _entry.EffectBasePoints[effIndex] = basePoints;
141 return *this;
142 }
std::array< int32, MAX_SPELL_EFFECTS > EffectBasePoints
Definition DBCStructure.h:1736

References _entry, SpellEntry::EffectBasePoints, and MAX_SPELL_EFFECTS.

Referenced by SpellInfoBuilder::WithEffectBasePoints().

◆ WithEffectDieSides()

TestSpellEntryHelper & TestSpellEntryHelper::WithEffectDieSides ( uint8  effIndex,
int32  dieSides 
)
inline
152 {
153 if (effIndex < MAX_SPELL_EFFECTS)
154 _entry.EffectDieSides[effIndex] = dieSides;
155 return *this;
156 }
std::array< int32, MAX_SPELL_EFFECTS > EffectDieSides
Definition DBCStructure.h:1734

References _entry, SpellEntry::EffectDieSides, and MAX_SPELL_EFFECTS.

Referenced by SpellInfoBuilder::WithEffectDieSides().

◆ WithEffectImplicitTargets()

TestSpellEntryHelper & TestSpellEntryHelper::WithEffectImplicitTargets ( uint8  effIndex,
uint32  targetA,
uint32  targetB = 0 
)
inline
119 {
120 if (effIndex < MAX_SPELL_EFFECTS)
121 {
122 _entry.EffectImplicitTargetA[effIndex] = targetA;
123 _entry.EffectImplicitTargetB[effIndex] = targetB;
124 }
125 return *this;
126 }
std::array< uint32, MAX_SPELL_EFFECTS > EffectImplicitTargetA
Definition DBCStructure.h:1738
std::array< uint32, MAX_SPELL_EFFECTS > EffectImplicitTargetB
Definition DBCStructure.h:1739

References _entry, SpellEntry::EffectImplicitTargetA, SpellEntry::EffectImplicitTargetB, and MAX_SPELL_EFFECTS.

Referenced by SpellInfoBuilder::WithEffectImplicitTargets().

◆ WithEffectMiscValue()

TestSpellEntryHelper & TestSpellEntryHelper::WithEffectMiscValue ( uint8  effIndex,
int32  miscValue 
)
inline
145 {
146 if (effIndex < MAX_SPELL_EFFECTS)
147 _entry.EffectMiscValue[effIndex] = miscValue;
148 return *this;
149 }
std::array< int32, MAX_SPELL_EFFECTS > EffectMiscValue
Definition DBCStructure.h:1746

References _entry, SpellEntry::EffectMiscValue, and MAX_SPELL_EFFECTS.

Referenced by SpellInfoBuilder::WithEffectMiscValue().

◆ WithEffectTriggerSpell()

TestSpellEntryHelper & TestSpellEntryHelper::WithEffectTriggerSpell ( uint8  effIndex,
uint32  triggerSpell 
)
inline
129 {
130 if (effIndex < MAX_SPELL_EFFECTS)
131 {
132 _entry.EffectTriggerSpell[effIndex] = triggerSpell;
133 }
134 return *this;
135 }
std::array< uint32, MAX_SPELL_EFFECTS > EffectTriggerSpell
Definition DBCStructure.h:1748

References _entry, SpellEntry::EffectTriggerSpell, and MAX_SPELL_EFFECTS.

Referenced by SpellInfoBuilder::WithEffectTriggerSpell().

◆ WithId()

TestSpellEntryHelper & TestSpellEntryHelper::WithId ( uint32  id)
inline
47 {
48 _entry.Id = id;
49 return *this;
50 }
uint32 Id
Definition DBCStructure.h:1679

References _entry, and SpellEntry::Id.

Referenced by SpellInfoBuilder::WithId().

◆ WithProcChance()

TestSpellEntryHelper & TestSpellEntryHelper::WithProcChance ( uint32  procChance)
inline
79 {
80 _entry.ProcChance = procChance;
81 return *this;
82 }
uint32 ProcChance
Definition DBCStructure.h:1712

References _entry, and SpellEntry::ProcChance.

Referenced by SpellInfoBuilder::WithProcChance().

◆ WithProcCharges()

TestSpellEntryHelper & TestSpellEntryHelper::WithProcCharges ( uint32  procCharges)
inline
85 {
86 _entry.ProcCharges = procCharges;
87 return *this;
88 }
uint32 ProcCharges
Definition DBCStructure.h:1713

References _entry, and SpellEntry::ProcCharges.

Referenced by SpellInfoBuilder::WithProcCharges().

◆ WithProcFlags()

TestSpellEntryHelper & TestSpellEntryHelper::WithProcFlags ( uint32  procFlags)
inline
73 {
74 _entry.ProcFlags = procFlags;
75 return *this;
76 }
uint32 ProcFlags
Definition DBCStructure.h:1711

References _entry, and SpellEntry::ProcFlags.

Referenced by SpellInfoBuilder::WithProcFlags().

◆ WithSchoolMask()

TestSpellEntryHelper & TestSpellEntryHelper::WithSchoolMask ( uint32  schoolMask)
inline
67 {
68 _entry.SchoolMask = schoolMask;
69 return *this;
70 }

References _entry, and SpellEntry::SchoolMask.

Referenced by SpellInfoBuilder::WithSchoolMask().

◆ WithSpellFamilyFlags()

TestSpellEntryHelper & TestSpellEntryHelper::WithSpellFamilyFlags ( uint32  flag0,
uint32  flag1 = 0,
uint32  flag2 = 0 
)
inline
59 {
60 _entry.SpellFamilyFlags[0] = flag0;
61 _entry.SpellFamilyFlags[1] = flag1;
62 _entry.SpellFamilyFlags[2] = flag2;
63 return *this;
64 }
flag96 SpellFamilyFlags
Definition DBCStructure.h:1768

References _entry, and SpellEntry::SpellFamilyFlags.

Referenced by SpellInfoBuilder::WithSpellFamilyFlags().

◆ WithSpellFamilyName()

TestSpellEntryHelper & TestSpellEntryHelper::WithSpellFamilyName ( uint32  familyName)
inline
53 {
54 _entry.SpellFamilyName = familyName;
55 return *this;
56 }
uint32 SpellFamilyName
Definition DBCStructure.h:1767

References _entry, and SpellEntry::SpellFamilyName.

Referenced by SpellInfoBuilder::WithSpellFamilyName().

Member Data Documentation

◆ _entry


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