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

#include "DatabaseScript.h"

Inheritance diagram for DatabaseScript:
ScriptObject

Public Member Functions

bool IsDatabaseBound () const override
 
virtual void OnAfterDatabasesLoaded (uint32)
 Called after all databases are loaded. More...
 
virtual void OnAfterDatabaseLoadCreatureTemplates (std::vector< CreatureTemplate * >)
 Called after all creature template data has been loaded from the database. This hook could be called multiple times, not just at server startup. More...
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 

Protected Member Functions

 DatabaseScript (const char *name, std::vector< uint16 > enabledHooks=std::vector< uint16 >())
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ DatabaseScript()

DatabaseScript::DatabaseScript ( const char *  name,
std::vector< uint16 enabledHooks = std::vector<uint16>() 
)
protected
34{
35 // If empty - enable all available hooks.
36 if (enabledHooks.empty())
37 for (uint16 i = 0; i < DATABASEHOOK_END; ++i)
38 enabledHooks.emplace_back(i);
39
40 ScriptRegistry<DatabaseScript>::AddScript(this, std::move(enabledHooks));
41}
std::uint16_t uint16
Definition: Define.h:108
@ DATABASEHOOK_END
Definition: DatabaseScript.h:28
static void AddScript(TScript *const script, std::vector< uint16 > enabledHooks={})
Definition: ScriptMgr.h:737
Definition: ScriptObject.h:44

References ScriptRegistry< TScript >::AddScript(), and DATABASEHOOK_END.

Member Function Documentation

◆ IsDatabaseBound()

bool DatabaseScript::IsDatabaseBound ( ) const
inlineoverridevirtual

Reimplemented from ScriptObject.

39{ return false; }

◆ OnAfterDatabaseLoadCreatureTemplates()

virtual void DatabaseScript::OnAfterDatabaseLoadCreatureTemplates ( std::vector< CreatureTemplate * >  )
inlinevirtual

Called after all creature template data has been loaded from the database. This hook could be called multiple times, not just at server startup.

Parameters
creatureTemplatesPointer to a modifiable vector of creature templates. Indexed by Entry ID.
53{ }

◆ OnAfterDatabasesLoaded()

virtual void DatabaseScript::OnAfterDatabasesLoaded ( uint32  )
inlinevirtual

Called after all databases are loaded.

Parameters
updateFlagsUpdate flags from the loader
46{ }