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

#include "WorldObjectScript.h"

Inheritance diagram for WorldObjectScript:
ScriptObject

Public Member Functions

bool IsDatabaseBound () const override
 
virtual void OnWorldObjectDestroy (WorldObject *)
 This hook called before destroy world object. More...
 
virtual void OnWorldObjectCreate (WorldObject *)
 This hook called after create world object. More...
 
virtual void OnWorldObjectSetMap (WorldObject *, Map *)
 This hook called after world object set to map. More...
 
virtual void OnWorldObjectResetMap (WorldObject *)
 This hook called after world object reset. More...
 
virtual void OnWorldObjectUpdate (WorldObject *, uint32)
 This hook called after world object update. 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

 WorldObjectScript (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

◆ WorldObjectScript()

WorldObjectScript::WorldObjectScript ( const char *  name,
std::vector< uint16 enabledHooks = std::vector<uint16>() 
)
protected
59{
60 // If empty - enable all available hooks.
61 if (enabledHooks.empty())
62 for (uint16 i = 0; i < WORLDOBJECTHOOK_END; ++i)
63 enabledHooks.emplace_back(i);
64
65 ScriptRegistry<WorldObjectScript>::AddScript(this, std::move(enabledHooks));
66}
std::uint16_t uint16
Definition: Define.h:108
@ WORLDOBJECTHOOK_END
Definition: WorldObjectScript.h:31
static void AddScript(TScript *const script, std::vector< uint16 > enabledHooks={})
Definition: ScriptMgr.h:737
Definition: ScriptObject.h:44

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

Member Function Documentation

◆ IsDatabaseBound()

bool WorldObjectScript::IsDatabaseBound ( ) const
inlineoverridevirtual

Reimplemented from ScriptObject.

40{ return false; }

◆ OnWorldObjectCreate()

virtual void WorldObjectScript::OnWorldObjectCreate ( WorldObject )
inlinevirtual

This hook called after create world object.

Parameters
objectContains information about the WorldObject
54{ }

◆ OnWorldObjectDestroy()

virtual void WorldObjectScript::OnWorldObjectDestroy ( WorldObject )
inlinevirtual

This hook called before destroy world object.

Parameters
objectContains information about the WorldObject
47{ }

◆ OnWorldObjectResetMap()

virtual void WorldObjectScript::OnWorldObjectResetMap ( WorldObject )
inlinevirtual

This hook called after world object reset.

Parameters
objectContains information about the WorldObject
68{ }

◆ OnWorldObjectSetMap()

virtual void WorldObjectScript::OnWorldObjectSetMap ( WorldObject ,
Map  
)
inlinevirtual

This hook called after world object set to map.

Parameters
objectContains information about the WorldObject
61{ }

◆ OnWorldObjectUpdate()

virtual void WorldObjectScript::OnWorldObjectUpdate ( WorldObject ,
uint32   
)
inlinevirtual

This hook called after world object update.

Parameters
objectContains information about the WorldObject
diffContains information about the diff time
76{ }