aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Scripting/ScriptMgr.h
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2022-02-12 21:36:46 +0100
committerShauren <shauren.trinity@gmail.com>2022-02-12 21:36:46 +0100
commitf8ad7017dd69e3853ed5912ac6151bc56b6265a0 (patch)
tree13c6568cf2e7b3a7ccb964b12f6686651f0e714d /src/server/game/Scripting/ScriptMgr.h
parent5b28a5ab14f3ca25f986d547e2d2005be3f047b7 (diff)
Core/Misc: Move (or delete) constructors and destructors to .cpp files (avoids compiling them in every file that includes them)
Diffstat (limited to 'src/server/game/Scripting/ScriptMgr.h')
-rw-r--r--src/server/game/Scripting/ScriptMgr.h94
1 files changed, 92 insertions, 2 deletions
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index 7aae463cd86..9d420542cae 100644
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -176,6 +176,11 @@ class TC_GAME_API ScriptObject
public:
+ ScriptObject(ScriptObject const& right) = delete;
+ ScriptObject(ScriptObject&& right) = delete;
+ ScriptObject& operator=(ScriptObject const& right) = delete;
+ ScriptObject& operator=(ScriptObject&& right) = delete;
+
const std::string& GetName() const { return _name; }
protected:
@@ -200,6 +205,11 @@ template<class TObject> class UpdatableScript
public:
+ UpdatableScript(UpdatableScript const& right) = delete;
+ UpdatableScript(UpdatableScript&& right) = delete;
+ UpdatableScript& operator=(UpdatableScript const& right) = delete;
+ UpdatableScript& operator=(UpdatableScript&& right) = delete;
+
virtual void OnUpdate(TObject* /*obj*/, uint32 /*diff*/) { }
};
@@ -226,6 +236,8 @@ class TC_GAME_API ServerScript : public ScriptObject
public:
+ ~ServerScript();
+
// Called when reactive socket I/O is started (WorldTcpSessionMgr).
virtual void OnNetworkStart() { }
@@ -256,6 +268,8 @@ class TC_GAME_API WorldScript : public ScriptObject
public:
+ ~WorldScript();
+
// Called when the open/closed state of the world changes.
virtual void OnOpenStateChange(bool /*open*/) { }
@@ -289,6 +303,8 @@ class TC_GAME_API FormulaScript : public ScriptObject
public:
+ ~FormulaScript();
+
// Called after calculating honor.
virtual void OnHonorCalculation(float& /*honor*/, uint8 /*level*/, float /*multiplier*/) { }
@@ -349,6 +365,10 @@ class TC_GAME_API WorldMapScript : public ScriptObject, public MapScript<Map>
protected:
WorldMapScript(char const* name, uint32 mapId);
+
+ public:
+
+ ~WorldMapScript();
};
class TC_GAME_API InstanceMapScript
@@ -360,6 +380,8 @@ class TC_GAME_API InstanceMapScript
public:
+ ~InstanceMapScript();
+
// Gets an InstanceScript object for this instance.
virtual InstanceScript* GetInstanceScript(InstanceMap* /*map*/) const { return nullptr; }
};
@@ -369,6 +391,10 @@ class TC_GAME_API BattlegroundMapScript : public ScriptObject, public MapScript<
protected:
BattlegroundMapScript(char const* name, uint32 mapId);
+
+ public:
+
+ ~BattlegroundMapScript();
};
class TC_GAME_API ItemScript : public ScriptObject
@@ -379,6 +405,8 @@ class TC_GAME_API ItemScript : public ScriptObject
public:
+ ~ItemScript();
+
// Called when a player accepts a quest from the item.
virtual bool OnQuestAccept(Player* /*player*/, Item* /*item*/, Quest const* /*quest*/) { return false; }
@@ -402,6 +430,9 @@ class TC_GAME_API UnitScript : public ScriptObject
UnitScript(char const* name);
public:
+
+ ~UnitScript();
+
// Called when a unit deals healing to another unit
virtual void OnHeal(Unit* /*healer*/, Unit* /*reciever*/, uint32& /*gain*/) { }
@@ -428,6 +459,9 @@ class TC_GAME_API CreatureScript : public ScriptObject
CreatureScript(char const* name);
public:
+
+ ~CreatureScript();
+
// Called when an unit exits a vehicle
virtual void ModifyVehiclePassengerExitPos(Unit* /*passenger*/, Vehicle* /*vehicle*/, Position& /*pos*/) { }
@@ -443,6 +477,8 @@ class TC_GAME_API GameObjectScript : public ScriptObject
public:
+ ~GameObjectScript();
+
// Called when a GameObjectAI object is needed for the gameobject.
virtual GameObjectAI* GetAI(GameObject* /*go*/) const = 0;
};
@@ -455,6 +491,8 @@ class TC_GAME_API AreaTriggerScript : public ScriptObject
public:
+ ~AreaTriggerScript();
+
// Called when the area trigger is activated by a player.
virtual bool OnTrigger(Player* /*player*/, AreaTriggerEntry const* /*trigger*/) { return false; }
@@ -464,9 +502,12 @@ class TC_GAME_API AreaTriggerScript : public ScriptObject
class TC_GAME_API OnlyOnceAreaTriggerScript : public AreaTriggerScript
{
- using AreaTriggerScript::AreaTriggerScript;
+ using AreaTriggerScript::AreaTriggerScript;
public:
+
+ ~OnlyOnceAreaTriggerScript();
+
bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) final;
protected:
@@ -484,6 +525,8 @@ class TC_GAME_API BattlefieldScript : public ScriptObject
public:
+ ~BattlefieldScript();
+
virtual Battlefield* GetBattlefield() const = 0;
};
@@ -495,6 +538,8 @@ class TC_GAME_API BattlegroundScript : public ScriptObject
public:
+ ~BattlegroundScript();
+
// Should return a fully valid Battleground object for the type ID.
virtual Battleground* GetBattleground() const = 0;
};
@@ -507,6 +552,8 @@ class TC_GAME_API OutdoorPvPScript : public ScriptObject
public:
+ ~OutdoorPvPScript();
+
// Should return a fully valid OutdoorPvP object for the type ID.
virtual OutdoorPvP* GetOutdoorPvP() const = 0;
};
@@ -519,6 +566,8 @@ class TC_GAME_API CommandScript : public ScriptObject
public:
+ ~CommandScript();
+
// Should return a pointer to a valid command table (ChatCommand array) to be used by ChatHandler.
virtual std::vector<ChatCommand> GetCommands() const = 0;
};
@@ -531,6 +580,8 @@ class TC_GAME_API WeatherScript : public ScriptObject, public UpdatableScript<We
public:
+ ~WeatherScript();
+
// Called when the weather changes in the zone this script is associated with.
virtual void OnChange(Weather* /*weather*/, WeatherState /*state*/, float /*grade*/) { }
};
@@ -543,6 +594,8 @@ class TC_GAME_API AuctionHouseScript : public ScriptObject
public:
+ ~AuctionHouseScript();
+
// Called when an auction is added to an auction house.
virtual void OnAuctionAdd(AuctionHouseObject* /*ah*/, AuctionPosting* /*auction*/) { }
@@ -564,6 +617,8 @@ class TC_GAME_API ConditionScript : public ScriptObject
public:
+ ~ConditionScript();
+
// Called when a single condition is checked for a player.
virtual bool OnConditionCheck(Condition const* /*condition*/, ConditionSourceInfo& /*sourceInfo*/) { return true; }
};
@@ -576,6 +631,8 @@ class TC_GAME_API VehicleScript : public ScriptObject
public:
+ ~VehicleScript();
+
// Called after a vehicle is installed.
virtual void OnInstall(Vehicle* /*veh*/) { }
@@ -600,6 +657,10 @@ class TC_GAME_API DynamicObjectScript : public ScriptObject, public UpdatableScr
protected:
DynamicObjectScript(char const* name);
+
+ public:
+
+ ~DynamicObjectScript();
};
class TC_GAME_API TransportScript : public ScriptObject, public UpdatableScript<Transport>
@@ -610,6 +671,8 @@ class TC_GAME_API TransportScript : public ScriptObject, public UpdatableScript<
public:
+ ~TransportScript();
+
// Called when a player boards the transport.
virtual void OnAddPassenger(Transport* /*transport*/, Player* /*player*/) { }
@@ -631,6 +694,8 @@ class TC_GAME_API AchievementScript : public ScriptObject
public:
+ ~AchievementScript();
+
// Called when an achievement is completed.
virtual void OnCompleted(Player* /*player*/, AchievementEntry const* /*achievement*/) { }
};
@@ -643,6 +708,8 @@ class TC_GAME_API AchievementCriteriaScript : public ScriptObject
public:
+ ~AchievementCriteriaScript();
+
// Called when an additional criteria is checked.
virtual bool OnCheck(Player* source, Unit* target) = 0;
};
@@ -655,6 +722,8 @@ class TC_GAME_API PlayerScript : public ScriptObject
public:
+ ~PlayerScript();
+
// Called when a player kills another player
virtual void OnPVPKill(Player* /*killer*/, Player* /*killed*/) { }
@@ -761,6 +830,8 @@ class TC_GAME_API AccountScript : public ScriptObject
public:
+ ~AccountScript();
+
// Called when an account logged in succesfully
virtual void OnAccountLogin(uint32 /*accountId*/) {}
@@ -788,6 +859,8 @@ class TC_GAME_API GuildScript : public ScriptObject
public:
+ ~GuildScript();
+
// Called when a member is added to the guild.
virtual void OnAddMember(Guild* /*guild*/, Player* /*player*/, uint8 /*plRank*/) { }
@@ -829,6 +902,8 @@ class TC_GAME_API GroupScript : public ScriptObject
public:
+ ~GroupScript();
+
// Called when a member is added to a group.
virtual void OnAddMember(Group* /*group*/, ObjectGuid /*guid*/) { }
@@ -853,6 +928,8 @@ class TC_GAME_API AreaTriggerEntityScript : public ScriptObject
public:
+ ~AreaTriggerEntityScript();
+
// Called when a AreaTriggerAI object is needed for the areatrigger.
virtual AreaTriggerAI* GetAI(AreaTrigger* /*at*/) const { return nullptr; }
};
@@ -864,6 +941,8 @@ class TC_GAME_API ConversationScript : public ScriptObject
public:
+ ~ConversationScript();
+
// Called when Conversation is created but not added to Map yet.
virtual void OnConversationCreate(Conversation* /*conversation*/, Unit* /*creator*/) { }
@@ -878,6 +957,9 @@ class TC_GAME_API SceneScript : public ScriptObject
SceneScript(char const* name);
public:
+
+ ~SceneScript();
+
// Called when a player start a scene
virtual void OnSceneStart(Player* /*player*/, uint32 /*sceneInstanceID*/, SceneTemplate const* /*sceneTemplate*/) { }
@@ -898,6 +980,9 @@ class TC_GAME_API QuestScript : public ScriptObject
QuestScript(char const* name);
public:
+
+ ~QuestScript();
+
// Called when a quest status change
virtual void OnQuestStatusChange(Player* /*player*/, Quest const* /*quest*/, QuestStatus /*oldStatus*/, QuestStatus /*newStatus*/) { }
@@ -915,7 +1000,12 @@ class TC_GAME_API ScriptMgr
private:
ScriptMgr();
- virtual ~ScriptMgr();
+ ~ScriptMgr();
+
+ ScriptMgr(ScriptMgr const& right) = delete;
+ ScriptMgr(ScriptMgr&& right) = delete;
+ ScriptMgr& operator=(ScriptMgr const& right) = delete;
+ ScriptMgr& operator=(ScriptMgr&& right) = delete;
void FillSpellSummary();
void LoadDatabase();