Core: SOme code cleanup, more to follow.
This commit is contained in:
@@ -471,7 +471,7 @@ namespace Game.BattleFields
|
||||
|
||||
public void SendUpdateWorldState(uint variable, uint value, bool hidden = false)
|
||||
{
|
||||
UpdateWorldState worldstate = new UpdateWorldState();
|
||||
UpdateWorldState worldstate = new();
|
||||
worldstate.VariableID = variable;
|
||||
worldstate.Value = (int)value;
|
||||
worldstate.Hidden = hidden;
|
||||
@@ -654,7 +654,7 @@ namespace Game.BattleFields
|
||||
|
||||
public void SendAreaSpiritHealerQuery(Player player, ObjectGuid guid)
|
||||
{
|
||||
AreaSpiritHealerTime areaSpiritHealerTime = new AreaSpiritHealerTime();
|
||||
AreaSpiritHealerTime areaSpiritHealerTime = new();
|
||||
areaSpiritHealerTime.HealerGuid = guid;
|
||||
areaSpiritHealerTime.TimeLeft = m_LastResurectTimer;// resurrect every 30 seconds
|
||||
|
||||
@@ -807,7 +807,7 @@ namespace Game.BattleFields
|
||||
protected uint m_DefenderTeam;
|
||||
|
||||
// Map of the objectives belonging to this OutdoorPvP
|
||||
Dictionary<uint, BfCapturePoint> m_capturePoints = new Dictionary<uint, BfCapturePoint>();
|
||||
Dictionary<uint, BfCapturePoint> m_capturePoints = new();
|
||||
|
||||
// Players info maps
|
||||
protected List<ObjectGuid>[] m_players = new List<ObjectGuid>[2]; // Players in zone
|
||||
@@ -835,7 +835,7 @@ namespace Game.BattleFields
|
||||
uint m_uiKickAfkPlayersTimer; // Timer for check Afk in war
|
||||
|
||||
// Graveyard variables
|
||||
protected List<BfGraveyard> m_GraveyardList = new List<BfGraveyard>(); // Vector witch contain the different GY of the battle
|
||||
protected List<BfGraveyard> m_GraveyardList = new(); // Vector witch contain the different GY of the battle
|
||||
uint m_LastResurectTimer; // Timer for resurect player every 30 sec
|
||||
|
||||
protected uint m_StartGroupingTimer; // Timer for invite players in area 15 minute before start battle
|
||||
@@ -843,8 +843,8 @@ namespace Game.BattleFields
|
||||
|
||||
List<ObjectGuid>[] m_Groups = new List<ObjectGuid>[2]; // Contain different raid group
|
||||
|
||||
Dictionary<int, ulong> m_Data64 = new Dictionary<int, ulong>();
|
||||
protected Dictionary<int, uint> m_Data32 = new Dictionary<int, uint>();
|
||||
Dictionary<int, ulong> m_Data64 = new();
|
||||
protected Dictionary<int, uint> m_Data32 = new();
|
||||
}
|
||||
|
||||
public class BfGraveyard
|
||||
@@ -992,7 +992,7 @@ namespace Game.BattleFields
|
||||
uint m_ControlTeam;
|
||||
uint m_GraveyardId;
|
||||
ObjectGuid[] m_SpiritGuide = new ObjectGuid[SharedConst.BGTeamsCount];
|
||||
List<ObjectGuid> m_ResurrectQueue = new List<ObjectGuid>();
|
||||
List<ObjectGuid> m_ResurrectQueue = new();
|
||||
protected BattleField m_Bf;
|
||||
}
|
||||
|
||||
@@ -1143,7 +1143,7 @@ namespace Game.BattleFields
|
||||
}
|
||||
}
|
||||
|
||||
List<Unit> players = new List<Unit>();
|
||||
List<Unit> players = new();
|
||||
var checker = new AnyPlayerInObjectRangeCheck(capturePoint, radius);
|
||||
var searcher = new PlayerListSearcher(capturePoint, players, checker);
|
||||
Cell.VisitWorldObjects(capturePoint, searcher, radius);
|
||||
|
||||
@@ -145,10 +145,10 @@ namespace Game.BattleFields
|
||||
|
||||
// contains all initiated battlefield events
|
||||
// used when initing / cleaning up
|
||||
List<BattleField> _battlefieldSet = new List<BattleField>();
|
||||
List<BattleField> _battlefieldSet = new();
|
||||
// maps the zone ids to an battlefield event
|
||||
// used in player event handling
|
||||
Dictionary<uint, BattleField> _battlefieldMap = new Dictionary<uint, BattleField>();
|
||||
Dictionary<uint, BattleField> _battlefieldMap = new();
|
||||
// update interval
|
||||
uint _updateTimer;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace Game.BattleFields
|
||||
|
||||
foreach (var gy in WGConst.WGGraveYard)
|
||||
{
|
||||
BfGraveyardWG graveyard = new BfGraveyardWG(this);
|
||||
BfGraveyardWG graveyard = new(this);
|
||||
|
||||
// When between games, the graveyard is controlled by the defending team
|
||||
if (gy.StartControl == TeamId.Neutral)
|
||||
@@ -101,7 +101,7 @@ namespace Game.BattleFields
|
||||
// Spawn workshop creatures and gameobjects
|
||||
for (byte i = 0; i < WGConst.MaxWorkshops; i++)
|
||||
{
|
||||
WGWorkshop workshop = new WGWorkshop(this, i);
|
||||
WGWorkshop workshop = new(this, i);
|
||||
if (i < WGWorkshopIds.Ne)
|
||||
workshop.GiveControlTo(GetAttackerTeam(), true);
|
||||
else
|
||||
@@ -129,7 +129,7 @@ namespace Game.BattleFields
|
||||
GameObject go = SpawnGameObject(build.Entry, build.Pos, build.Rot);
|
||||
if (go)
|
||||
{
|
||||
BfWGGameObjectBuilding b = new BfWGGameObjectBuilding(this, build.BuildingType, build.WorldState);
|
||||
BfWGGameObjectBuilding b = new(this, build.BuildingType, build.WorldState);
|
||||
b.Init(go);
|
||||
if (!IsEnabled() && go.GetEntry() == WGGameObjects.VaultGate)
|
||||
go.SetDestructibleState(GameObjectDestructibleState.Destroyed);
|
||||
@@ -551,7 +551,7 @@ namespace Game.BattleFields
|
||||
{
|
||||
if (workshop.GetId() == workshopId)
|
||||
{
|
||||
WintergraspCapturePoint capturePoint = new WintergraspCapturePoint(this, GetAttackerTeam());
|
||||
WintergraspCapturePoint capturePoint = new(this, GetAttackerTeam());
|
||||
|
||||
capturePoint.SetCapturePointData(go);
|
||||
capturePoint.LinkToWorkshop(workshop);
|
||||
@@ -782,7 +782,7 @@ namespace Game.BattleFields
|
||||
|
||||
void SendInitWorldStatesTo(Player player)
|
||||
{
|
||||
InitWorldStates packet = new InitWorldStates();
|
||||
InitWorldStates packet = new();
|
||||
packet.AreaID = m_ZoneId;
|
||||
packet.MapID = m_MapId;
|
||||
packet.SubareaID = 0;
|
||||
@@ -1028,13 +1028,13 @@ namespace Game.BattleFields
|
||||
|
||||
bool m_isRelicInteractible;
|
||||
|
||||
List<WGWorkshop> Workshops = new List<WGWorkshop>();
|
||||
List<WGWorkshop> Workshops = new();
|
||||
|
||||
List<ObjectGuid>[] DefenderPortalList = new List<ObjectGuid>[SharedConst.BGTeamsCount];
|
||||
List<BfWGGameObjectBuilding> BuildingsInZone = new List<BfWGGameObjectBuilding>();
|
||||
List<BfWGGameObjectBuilding> BuildingsInZone = new();
|
||||
|
||||
List<ObjectGuid>[] m_vehicles = new List<ObjectGuid>[SharedConst.BGTeamsCount];
|
||||
List<ObjectGuid> CanonList = new List<ObjectGuid>();
|
||||
List<ObjectGuid> CanonList = new();
|
||||
|
||||
int m_tenacityTeam;
|
||||
uint m_tenacityStack;
|
||||
@@ -1476,8 +1476,8 @@ namespace Game.BattleFields
|
||||
// Creature associations
|
||||
List<ObjectGuid>[] m_CreatureBottomList = new List<ObjectGuid>[SharedConst.BGTeamsCount];
|
||||
List<ObjectGuid>[] m_CreatureTopList = new List<ObjectGuid>[SharedConst.BGTeamsCount];
|
||||
List<ObjectGuid> m_TowerCannonBottomList = new List<ObjectGuid>();
|
||||
List<ObjectGuid> m_TurretTopList = new List<ObjectGuid>();
|
||||
List<ObjectGuid> m_TowerCannonBottomList = new();
|
||||
List<ObjectGuid> m_TurretTopList = new();
|
||||
}
|
||||
|
||||
class WGWorkshop
|
||||
|
||||
@@ -45,10 +45,10 @@ namespace Game.BattleFields
|
||||
public static uint[] ClockWorldState = { 3781, 4354 };
|
||||
public static uint[] WintergraspFaction = { 1732, 1735, 35 };
|
||||
|
||||
public static Position WintergraspStalkerPos = new Position(4948.985f, 2937.789f, 550.5172f, 1.815142f);
|
||||
public static Position WintergraspStalkerPos = new(4948.985f, 2937.789f, 550.5172f, 1.815142f);
|
||||
|
||||
public static Position RelicPos = new Position(5440.379f, 2840.493f, 430.2816f, -1.832595f);
|
||||
public static Quaternion RelicRot = new Quaternion(0.0f, 0.0f, -0.7933531f, 0.6087617f);
|
||||
public static Position RelicPos = new(5440.379f, 2840.493f, 430.2816f, -1.832595f);
|
||||
public static Quaternion RelicRot = new(0.0f, 0.0f, -0.7933531f, 0.6087617f);
|
||||
|
||||
//Destructible (Wall, Tower..)
|
||||
public static WintergraspBuildingSpawnData[] WGGameObjectBuilding =
|
||||
|
||||
Reference in New Issue
Block a user