コード例 #1
0
        public bool Equals(BaseStat other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(DestroyedEnemyVehicles.OrderBy(dev => dev.Enemy.BaseId).SequenceEqual(other.DestroyedEnemyVehicles.OrderBy(dev => dev.Enemy.BaseId)) &&
                   EnemyKills.OrderBy(dev => dev.Enemy.BaseId).SequenceEqual(other.EnemyKills.OrderBy(dev => dev.Enemy.BaseId)) &&
                   FastestMatchWin.Equals(other.FastestMatchWin) &&
                   Impulses.OrderBy(i => i.Id).SequenceEqual(other.Impulses.OrderBy(i => i.Id)) &&
                   MedalAwards.OrderBy(ma => ma.MedalId).SequenceEqual(other.MedalAwards.OrderBy(ma => ma.MedalId)) &&
                   TotalAssassinations == other.TotalAssassinations &&
                   TotalAssists == other.TotalAssists &&
                   TotalDeaths == other.TotalDeaths &&
                   TotalGamesCompleted == other.TotalGamesCompleted &&
                   TotalGamesLost == other.TotalGamesLost &&
                   TotalGamesTied == other.TotalGamesTied &&
                   TotalGamesWon == other.TotalGamesWon &&
                   TotalGrenadeDamage.Equals(other.TotalGrenadeDamage) &&
                   TotalGrenadeKills == other.TotalGrenadeKills &&
                   TotalGroundPoundDamage.Equals(other.TotalGroundPoundDamage) &&
                   TotalGroundPoundKills == other.TotalGroundPoundKills &&
                   TotalHeadshots == other.TotalHeadshots &&
                   TotalKills == other.TotalKills &&
                   TotalMeleeDamage.Equals(other.TotalMeleeDamage) &&
                   TotalMeleeKills == other.TotalMeleeKills &&
                   TotalPowerWeaponDamage.Equals(other.TotalPowerWeaponDamage) &&
                   TotalPowerWeaponGrabs == other.TotalPowerWeaponGrabs &&
                   TotalPowerWeaponKills == other.TotalPowerWeaponKills &&
                   TotalPowerWeaponPossessionTime.Equals(other.TotalPowerWeaponPossessionTime) &&
                   TotalShotsFired == other.TotalShotsFired &&
                   TotalShotsLanded == other.TotalShotsLanded &&
                   TotalShoulderBashDamage.Equals(other.TotalShoulderBashDamage) &&
                   TotalShoulderBashKills == other.TotalShoulderBashKills &&
                   TotalSpartanKills == other.TotalSpartanKills &&
                   TotalTimePlayed.Equals(other.TotalTimePlayed) &&
                   TotalWeaponDamage.Equals(other.TotalWeaponDamage) &&
                   WeaponStats.OrderBy(ws => ws.WeaponId.StockId).SequenceEqual(other.WeaponStats.OrderBy(ws => ws.WeaponId.StockId)) &&
                   Equals(WeaponWithMostKills, other.WeaponWithMostKills));
        }
コード例 #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = DestroyedEnemyVehicles?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (EnemyKills?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ FastestMatchWin.GetHashCode();
         hashCode = (hashCode * 397) ^ (Impulses?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (MedalAwards?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ TotalAssassinations;
         hashCode = (hashCode * 397) ^ TotalAssists;
         hashCode = (hashCode * 397) ^ TotalDeaths;
         hashCode = (hashCode * 397) ^ TotalGamesCompleted;
         hashCode = (hashCode * 397) ^ TotalGamesLost;
         hashCode = (hashCode * 397) ^ TotalGamesTied;
         hashCode = (hashCode * 397) ^ TotalGamesWon;
         hashCode = (hashCode * 397) ^ TotalGrenadeDamage.GetHashCode();
         hashCode = (hashCode * 397) ^ TotalGrenadeKills;
         hashCode = (hashCode * 397) ^ TotalGroundPoundDamage.GetHashCode();
         hashCode = (hashCode * 397) ^ TotalGroundPoundKills;
         hashCode = (hashCode * 397) ^ TotalHeadshots;
         hashCode = (hashCode * 397) ^ TotalKills;
         hashCode = (hashCode * 397) ^ TotalMeleeDamage.GetHashCode();
         hashCode = (hashCode * 397) ^ TotalMeleeKills;
         hashCode = (hashCode * 397) ^ TotalPowerWeaponDamage.GetHashCode();
         hashCode = (hashCode * 397) ^ TotalPowerWeaponGrabs;
         hashCode = (hashCode * 397) ^ TotalPowerWeaponKills;
         hashCode = (hashCode * 397) ^ TotalPowerWeaponPossessionTime.GetHashCode();
         hashCode = (hashCode * 397) ^ TotalShotsFired;
         hashCode = (hashCode * 397) ^ TotalShotsLanded;
         hashCode = (hashCode * 397) ^ TotalShoulderBashDamage.GetHashCode();
         hashCode = (hashCode * 397) ^ TotalShoulderBashKills;
         hashCode = (hashCode * 397) ^ TotalSpartanKills;
         hashCode = (hashCode * 397) ^ TotalTimePlayed.GetHashCode();
         hashCode = (hashCode * 397) ^ TotalWeaponDamage.GetHashCode();
         hashCode = (hashCode * 397) ^ (WeaponStats?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (WeaponWithMostKills?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }