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)
 
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 // Zero initialize all fields
36 std::memset(&_entry, 0, sizeof(_entry));
37
38 // Set safe defaults
41
42 // Initialize empty strings
43 for (auto& name : _entry.SpellName)
44 name = "";
45 for (auto& rank : _entry.Rank)
46 rank = "";
47 }
@ SPELL_SCHOOL_MASK_NORMAL
Definition SharedDefines.h:285
SpellEntry _entry
Definition SpellInfoTestHelper.h:150
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
145 {
146 return &_entry;
147 }

References _entry.

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

◆ WithAttributes()

TestSpellEntryHelper & TestSpellEntryHelper::WithAttributes ( uint32  attr)
inline
139 {
140 _entry.Attributes = attr;
141 return *this;
142 }
uint32 Attributes
Definition DBCStructure.h:1647

References _entry, and SpellEntry::Attributes.

Referenced by SpellInfoBuilder::WithAttributes().

◆ WithAttributesEx3()

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

References _entry, and SpellEntry::AttributesEx3.

Referenced by SpellInfoBuilder::WithAttributesEx3().

◆ WithDmgClass()

TestSpellEntryHelper & TestSpellEntryHelper::WithDmgClass ( uint32  dmgClass)
inline
94 {
95 _entry.DmgClass = dmgClass;
96 return *this;
97 }
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
106 {
107 if (effIndex < MAX_SPELL_EFFECTS)
108 {
109 _entry.Effect[effIndex] = effect;
110 _entry.EffectApplyAuraName[effIndex] = auraType;
111 }
112 return *this;
113 }
#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
125 {
126 if (effIndex < MAX_SPELL_EFFECTS)
127 _entry.EffectBasePoints[effIndex] = basePoints;
128 return *this;
129 }
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
132 {
133 if (effIndex < MAX_SPELL_EFFECTS)
134 _entry.EffectDieSides[effIndex] = dieSides;
135 return *this;
136 }
std::array< int32, MAX_SPELL_EFFECTS > EffectDieSides
Definition DBCStructure.h:1698

References _entry, SpellEntry::EffectDieSides, and MAX_SPELL_EFFECTS.

Referenced by SpellInfoBuilder::WithEffectDieSides().

◆ WithEffectTriggerSpell()

TestSpellEntryHelper & TestSpellEntryHelper::WithEffectTriggerSpell ( uint8  effIndex,
uint32  triggerSpell 
)
inline
116 {
117 if (effIndex < MAX_SPELL_EFFECTS)
118 {
119 _entry.EffectTriggerSpell[effIndex] = triggerSpell;
120 }
121 return *this;
122 }
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
50 {
51 _entry.Id = id;
52 return *this;
53 }
uint32 Id
Definition DBCStructure.h:1643

References _entry, and SpellEntry::Id.

Referenced by SpellInfoBuilder::WithId().

◆ WithProcChance()

TestSpellEntryHelper & TestSpellEntryHelper::WithProcChance ( uint32  procChance)
inline
82 {
83 _entry.ProcChance = procChance;
84 return *this;
85 }
uint32 ProcChance
Definition DBCStructure.h:1676

References _entry, and SpellEntry::ProcChance.

Referenced by SpellInfoBuilder::WithProcChance().

◆ WithProcCharges()

TestSpellEntryHelper & TestSpellEntryHelper::WithProcCharges ( uint32  procCharges)
inline
88 {
89 _entry.ProcCharges = procCharges;
90 return *this;
91 }
uint32 ProcCharges
Definition DBCStructure.h:1677

References _entry, and SpellEntry::ProcCharges.

Referenced by SpellInfoBuilder::WithProcCharges().

◆ WithProcFlags()

TestSpellEntryHelper & TestSpellEntryHelper::WithProcFlags ( uint32  procFlags)
inline
76 {
77 _entry.ProcFlags = procFlags;
78 return *this;
79 }
uint32 ProcFlags
Definition DBCStructure.h:1675

References _entry, and SpellEntry::ProcFlags.

Referenced by SpellInfoBuilder::WithProcFlags().

◆ WithSchoolMask()

TestSpellEntryHelper & TestSpellEntryHelper::WithSchoolMask ( uint32  schoolMask)
inline
70 {
71 _entry.SchoolMask = schoolMask;
72 return *this;
73 }

References _entry, and SpellEntry::SchoolMask.

Referenced by SpellInfoBuilder::WithSchoolMask().

◆ WithSpellFamilyFlags()

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

References _entry, and SpellEntry::SpellFamilyFlags.

Referenced by SpellInfoBuilder::WithSpellFamilyFlags().

◆ WithSpellFamilyName()

TestSpellEntryHelper & TestSpellEntryHelper::WithSpellFamilyName ( uint32  familyName)
inline
56 {
57 _entry.SpellFamilyName = familyName;
58 return *this;
59 }
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: