Core/Battleground: Rework BattlegroundScore
Port From (https://github.com/TrinityCore/TrinityCore/commit/da0ec4f830c4428a17fd4e52124dca6c63e25961)
This commit is contained in:
@@ -1,50 +1,8 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.BattleGrounds;
|
||||
using Game.Entities;
|
||||
using Game.Networking.Packets;
|
||||
|
||||
namespace Game.Arenas
|
||||
{
|
||||
class ArenaScore : BattlegroundScore
|
||||
{
|
||||
public ArenaScore(ObjectGuid playerGuid, Team team) : base(playerGuid, team)
|
||||
{
|
||||
TeamId = (int)(team == Team.Alliance ? PvPTeamId.Alliance : PvPTeamId.Horde);
|
||||
}
|
||||
|
||||
public override void BuildPvPLogPlayerDataPacket(out PVPMatchStatistics.PVPMatchPlayerStatistics playerData)
|
||||
{
|
||||
base.BuildPvPLogPlayerDataPacket(out playerData);
|
||||
|
||||
if (PreMatchRating != 0)
|
||||
playerData.PreMatchRating = PreMatchRating;
|
||||
|
||||
if (PostMatchRating != PreMatchRating)
|
||||
playerData.RatingChange = (int)(PostMatchRating - PreMatchRating);
|
||||
|
||||
if (PreMatchMMR != 0)
|
||||
playerData.PreMatchMMR = PreMatchMMR;
|
||||
|
||||
if (PostMatchMMR != PreMatchMMR)
|
||||
playerData.MmrChange = (int)(PostMatchMMR - PreMatchMMR);
|
||||
}
|
||||
|
||||
// For Logging purpose
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Damage done: {DamageDone} Healing done: {HealingDone} Killing blows: {KillingBlows} PreMatchRating: {PreMatchRating} " +
|
||||
$"PreMatchMMR: {PreMatchMMR} PostMatchRating: {PostMatchRating} PostMatchMMR: {PostMatchMMR}";
|
||||
}
|
||||
|
||||
uint PreMatchRating;
|
||||
uint PreMatchMMR;
|
||||
uint PostMatchRating;
|
||||
uint PostMatchMMR;
|
||||
}
|
||||
|
||||
public class ArenaTeamScore
|
||||
{
|
||||
public void Assign(uint preMatchRating, uint postMatchRating, uint preMatchMMR, uint postMatchMMR)
|
||||
|
||||
Reference in New Issue
Block a user