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 ()
 
TestSpellEntryHelperWithId (uint32 id)
 
TestSpellEntryHelperWithSpellFamilyName (uint32 familyName)
 
TestSpellEntryHelperWithSpellFamilyFlags (uint32 flag0, uint32 flag1=0, uint32 flag2=0)
 
TestSpellEntryHelperWithSchoolMask (uint32 schoolMask)
 
TestSpellEntryHelperWithProcFlags (uint32 procFlags)
 
TestSpellEntryHelperWithProcChance (uint32 procChance)
 
TestSpellEntryHelperWithProcCharges (uint32 procCharges)
 
TestSpellEntryHelperWithDmgClass (uint32 dmgClass)
 
TestSpellEntryHelperWithAttributesEx3 (uint32 attr)
 
TestSpellEntryHelperWithEffect (uint8 effIndex, uint32 effect, uint32 auraType=0)
 
TestSpellEntryHelperWithEffectTriggerSpell (uint8 effIndex, uint32 triggerSpell)
 
TestSpellEntryHelperWithEffectBasePoints (uint8 effIndex, int32 basePoints)
 
TestSpellEntryHelperWithEffectMiscValue (uint8 effIndex, int32 miscValue)
 
TestSpellEntryHelperWithEffectDieSides (uint8 effIndex, int32 dieSides)
 
TestSpellEntryHelperWithAttributes (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:154
int32 EquippedItemClass
Definition DBCStructure.h:1694
uint32 SchoolMask
Definition DBCStructure.h:1743

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
149 {
150 return &_entry;
151 }

References _entry.

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

◆ WithAttributes()

TestSpellEntryHelper & TestSpellEntryHelper::WithAttributes ( uint32  attr)
inline
143 {
144 _entry.Attributes = attr;
145 return *this;
146 }
uint32 Attributes
Definition DBCStructure.h:1647

References _entry, and SpellEntry::Attributes.

Referenced by SpellInfoBuilder::WithAttributes().

◆ WithAttributesEx3()

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

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:1734

References _entry, and SpellEntry::DmgClass.

Referenced by SpellInfoBuilder::WithDmgClass().

◆ WithEffect()

TestSpellEntryHelper & TestSpellEntryHelper::WithEffect ( uint8  effIndex,
uint32  effect,
uint32  auraType = 0 
)
inline
103 {
104 if (effIndex < MAX_SPELL_EFFECTS)
105 {
106 _entry.Effect[effIndex] = effect;
107 _entry.EffectApplyAuraName[effIndex] = auraType;
108 }
109 return *this;
110 }
#define MAX_SPELL_EFFECTS
Definition DBCStructure.h:1637
std::array< uint32, MAX_SPELL_EFFECTS > EffectApplyAuraName
Definition DBCStructure.h:1705
std::array< uint32, MAX_SPELL_EFFECTS > Effect
Definition DBCStructure.h:1697

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

Referenced by SpellInfoBuilder::WithEffect().

◆ WithEffectBasePoints()

TestSpellEntryHelper & TestSpellEntryHelper::WithEffectBasePoints ( uint8  effIndex,
int32  basePoints 
)
inline
122 {
123 if (effIndex < MAX_SPELL_EFFECTS)
124 _entry.EffectBasePoints[effIndex] = basePoints;
125 return *this;
126 }
std::array< int32, MAX_SPELL_EFFECTS > EffectBasePoints
Definition DBCStructure.h:1700

References _entry, SpellEntry::EffectBasePoints, and MAX_SPELL_EFFECTS.

Referenced by SpellInfoBuilder::WithEffectBasePoints().

◆ WithEffectDieSides()

TestSpellEntryHelper & TestSpellEntryHelper::WithEffectDieSides ( uint8  effIndex,
int32  dieSides 
)
inline
136 {
137 if (effIndex < MAX_SPELL_EFFECTS)
138 _entry.EffectDieSides[effIndex] = dieSides;
139 return *this;
140 }
std::array< int32, MAX_SPELL_EFFECTS > EffectDieSides
Definition DBCStructure.h:1698

References _entry, SpellEntry::EffectDieSides, and MAX_SPELL_EFFECTS.

Referenced by SpellInfoBuilder::WithEffectDieSides().

◆ WithEffectMiscValue()

TestSpellEntryHelper & TestSpellEntryHelper::WithEffectMiscValue ( uint8  effIndex,
int32  miscValue 
)
inline
129 {
130 if (effIndex < MAX_SPELL_EFFECTS)
131 _entry.EffectMiscValue[effIndex] = miscValue;
132 return *this;
133 }
std::array< int32, MAX_SPELL_EFFECTS > EffectMiscValue
Definition DBCStructure.h:1710

References _entry, SpellEntry::EffectMiscValue, and MAX_SPELL_EFFECTS.

Referenced by SpellInfoBuilder::WithEffectMiscValue().

◆ WithEffectTriggerSpell()

TestSpellEntryHelper & TestSpellEntryHelper::WithEffectTriggerSpell ( uint8  effIndex,
uint32  triggerSpell 
)
inline
113 {
114 if (effIndex < MAX_SPELL_EFFECTS)
115 {
116 _entry.EffectTriggerSpell[effIndex] = triggerSpell;
117 }
118 return *this;
119 }
std::array< uint32, MAX_SPELL_EFFECTS > EffectTriggerSpell
Definition DBCStructure.h:1712

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:1643

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:1676

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:1677

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:1675

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:1732

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:1731

References _entry, and SpellEntry::SpellFamilyName.

Referenced by SpellInfoBuilder::WithSpellFamilyName().

Member Data Documentation

◆ _entry


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