Core/Maps: Move terrain data handling out of Map class

Port From (https://github.com/TrinityCore/TrinityCore/commit/16a06346aea16ffd6ee84081cedfdb0c75ac0b38)
This commit is contained in:
hondacrx
2022-07-24 16:31:00 -04:00
parent c4344fbf66
commit 3cd58e4a17
25 changed files with 1035 additions and 960 deletions
-6
View File
@@ -205,12 +205,6 @@ namespace Game.Scripting
// Called just before the map is destroyed.
public virtual void OnDestroy(T map) { }
// Called when a grid map is loaded.
public virtual void OnLoadGridMap(T map, GridMap gmap, uint gx, uint gy) { }
// Called when a grid map is unloaded.
public virtual void OnUnloadGridMap(T map, GridMap gmap, uint gx, uint gy) { }
// Called when a player enters the map.
public virtual void OnPlayerEnter(T map, Player player) { }
-31
View File
@@ -564,37 +564,6 @@ namespace Game.Scripting
if (record != null && record.IsBattleground())
ForEach<BattlegroundMapScript>(p => p.OnDestroy(map.ToBattlegroundMap()));
}
public void OnLoadGridMap(Map map, GridMap gmap, uint gx, uint gy)
{
Cypher.Assert(map != null);
Cypher.Assert(gmap != null);
var record = map.GetEntry();
if (record != null && record.IsWorldMap())
ForEach<WorldMapScript>(p => p.OnLoadGridMap(map, gmap, gx, gy));
if (record != null && record.IsDungeon())
ForEach<InstanceMapScript>(p => p.OnLoadGridMap(map.ToInstanceMap(), gmap, gx, gy));
if (record != null && record.IsBattleground())
ForEach<BattlegroundMapScript>(p => p.OnLoadGridMap(map.ToBattlegroundMap(), gmap, gx, gy));
}
public void OnUnloadGridMap(Map map, GridMap gmap, uint gx, uint gy)
{
Cypher.Assert(map != null);
Cypher.Assert(gmap != null);
var record = map.GetEntry();
if (record != null && record.IsWorldMap())
ForEach<WorldMapScript>(p => p.OnUnloadGridMap(map, gmap, gx, gy));
if (record != null && record.IsDungeon())
ForEach<InstanceMapScript>(p => p.OnUnloadGridMap(map.ToInstanceMap(), gmap, gx, gy));
if (record != null && record.IsBattleground())
ForEach<BattlegroundMapScript>(p => p.OnUnloadGridMap(map.ToBattlegroundMap(), gmap, gx, gy));
}
public void OnPlayerEnterMap(Map map, Player player)
{
Cypher.Assert(map != null);