Core: SOme code cleanup, more to follow.

This commit is contained in:
hondacrx
2021-03-20 22:48:48 -04:00
parent 62f554f2e0
commit 62ec699ec6
318 changed files with 5080 additions and 5125 deletions
+8 -8
View File
@@ -245,7 +245,7 @@ namespace Game.PvP
public void SendDefenseMessage(uint zoneId, uint id)
{
DefenseMessageBuilder builder = new DefenseMessageBuilder(zoneId, id);
DefenseMessageBuilder builder = new(zoneId, id);
var localizer = new LocalizedPacketDo(builder);
BroadcastWorker(localizer, zoneId);
}
@@ -304,7 +304,7 @@ namespace Game.PvP
}
// the map of the objectives belonging to this outdoorpvp
public Dictionary<ulong, OPvPCapturePoint> m_capturePoints = new Dictionary<ulong, OPvPCapturePoint>();
public Dictionary<ulong, OPvPCapturePoint> m_capturePoints = new();
List<ObjectGuid>[] m_players = new List<ObjectGuid>[2];
public OutdoorPvPTypes m_TypeId;
bool m_sendUpdate;
@@ -521,7 +521,7 @@ namespace Game.PvP
}
}
List<Unit> players = new List<Unit>();
List<Unit> players = new();
var checker = new AnyPlayerInObjectRangeCheck(m_capturePoint, radius);
var searcher = new PlayerListSearcher(m_capturePoint, players, checker);
Cell.VisitWorldObjects(m_capturePoint, searcher, radius);
@@ -722,10 +722,10 @@ namespace Game.PvP
// pointer to the OutdoorPvP this objective belongs to
public OutdoorPvP PvP { get; set; }
public Dictionary<uint, ulong> m_Objects = new Dictionary<uint, ulong>();
public Dictionary<uint, ulong> m_Creatures = new Dictionary<uint, ulong>();
Dictionary<ulong, uint> m_ObjectTypes = new Dictionary<ulong, uint>();
Dictionary<ulong, uint> m_CreatureTypes = new Dictionary<ulong, uint>();
public Dictionary<uint, ulong> m_Objects = new();
public Dictionary<uint, ulong> m_Creatures = new();
Dictionary<ulong, uint> m_ObjectTypes = new();
Dictionary<ulong, uint> m_CreatureTypes = new();
}
class DefenseMessageBuilder : MessageBuilder
@@ -740,7 +740,7 @@ namespace Game.PvP
{
string text = Global.OutdoorPvPMgr.GetDefenseMessage(_zoneId, _id, locale);
DefenseMessage defenseMessage = new DefenseMessage();
DefenseMessage defenseMessage = new();
defenseMessage.ZoneID = _zoneId;
defenseMessage.MessageText = text;
return defenseMessage;
+3 -3
View File
@@ -224,14 +224,14 @@ namespace Game.PvP
// contains all initiated outdoor pvp events
// used when initing / cleaning up
List<OutdoorPvP> m_OutdoorPvPSet = new List<OutdoorPvP>();
List<OutdoorPvP> m_OutdoorPvPSet = new();
// maps the zone ids to an outdoor pvp event
// used in player event handling
Dictionary<uint, OutdoorPvP> m_OutdoorPvPMap = new Dictionary<uint, OutdoorPvP>();
Dictionary<uint, OutdoorPvP> m_OutdoorPvPMap = new();
// Holds the outdoor PvP templates
Dictionary<OutdoorPvPTypes, uint> OutdoorPvPScriptIds = new Dictionary<OutdoorPvPTypes, uint>();
Dictionary<OutdoorPvPTypes, uint> OutdoorPvPScriptIds = new();
// update interval
uint m_UpdateTimer;