AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
GenericSpellAndAuraScriptLoader< Ts > Class Template Reference

#include "SpellScriptLoader.h"

Inheritance diagram for GenericSpellAndAuraScriptLoader< Ts >:
SpellScriptLoader ScriptObject

Public Member Functions

 GenericSpellAndAuraScriptLoader (char const *name, ArgsType &&args)
 
- Public Member Functions inherited from SpellScriptLoader
bool IsDatabaseBound () const override
 
virtual SpellScriptGetSpellScript () const
 
virtual AuraScriptGetAuraScript () const
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 

Private Types

using SpellScriptType = typename Acore::find_type_if_t< Acore::SpellScripts::is_SpellScript, Ts... >
 
using AuraScriptType = typename Acore::find_type_if_t< Acore::SpellScripts::is_AuraScript, Ts... >
 
using ArgsType = typename Acore::find_type_if_t< Acore::is_tuple, Ts... >
 

Private Member Functions

SpellScriptGetSpellScript () const override
 
AuraScriptGetAuraScript () const override
 

Private Attributes

ArgsType _args
 

Additional Inherited Members

- Protected Member Functions inherited from SpellScriptLoader
 SpellScriptLoader (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 

Detailed Description

template<typename... Ts>
class GenericSpellAndAuraScriptLoader< Ts >

Member Typedef Documentation

◆ ArgsType

template<typename... Ts>
using GenericSpellAndAuraScriptLoader< Ts >::ArgsType = typename Acore::find_type_if_t<Acore::is_tuple, Ts...>
private

◆ AuraScriptType

template<typename... Ts>
using GenericSpellAndAuraScriptLoader< Ts >::AuraScriptType = typename Acore::find_type_if_t<Acore::SpellScripts::is_AuraScript, Ts...>
private

◆ SpellScriptType

template<typename... Ts>
using GenericSpellAndAuraScriptLoader< Ts >::SpellScriptType = typename Acore::find_type_if_t<Acore::SpellScripts::is_SpellScript, Ts...>
private

Constructor & Destructor Documentation

◆ GenericSpellAndAuraScriptLoader()

template<typename... Ts>
GenericSpellAndAuraScriptLoader< Ts >::GenericSpellAndAuraScriptLoader ( char const *  name,
ArgsType &&  args 
)
inline
57: SpellScriptLoader(name), _args(std::move(args)) { }
Definition: SpellScriptLoader.h:26
ArgsType _args
Definition: SpellScriptLoader.h:84

Member Function Documentation

◆ GetAuraScript()

template<typename... Ts>
AuraScript * GenericSpellAndAuraScriptLoader< Ts >::GetAuraScript ( ) const
inlineoverrideprivatevirtual

Reimplemented from SpellScriptLoader.

73 {
74 if constexpr (!std::is_same_v<AuraScriptType, Acore::find_type_end>)
75 {
76 return Acore::new_from_tuple<AuraScriptType>(_args);
77 }
78 else
79 {
80 return nullptr;
81 }
82 }

References GenericSpellAndAuraScriptLoader< Ts >::_args.

◆ GetSpellScript()

template<typename... Ts>
SpellScript * GenericSpellAndAuraScriptLoader< Ts >::GetSpellScript ( ) const
inlineoverrideprivatevirtual

Reimplemented from SpellScriptLoader.

61 {
62 if constexpr (!std::is_same_v<SpellScriptType, Acore::find_type_end>)
63 {
64 return Acore::new_from_tuple<SpellScriptType>(_args);
65 }
66 else
67 {
68 return nullptr;
69 }
70 }

References GenericSpellAndAuraScriptLoader< Ts >::_args.

Member Data Documentation

◆ _args