Пример #1
0
 public static void Serialize(Stream stream, PlayerWeaponStatisticsView instance)
 {
     using (MemoryStream memoryStream = new MemoryStream())
     {
         Int32Proxy.Serialize(memoryStream, instance.CannonTotalDamageDone);
         Int32Proxy.Serialize(memoryStream, instance.CannonTotalShotsFired);
         Int32Proxy.Serialize(memoryStream, instance.CannonTotalShotsHit);
         Int32Proxy.Serialize(memoryStream, instance.CannonTotalSplats);
         Int32Proxy.Serialize(memoryStream, instance.LauncherTotalDamageDone);
         Int32Proxy.Serialize(memoryStream, instance.LauncherTotalShotsFired);
         Int32Proxy.Serialize(memoryStream, instance.LauncherTotalShotsHit);
         Int32Proxy.Serialize(memoryStream, instance.LauncherTotalSplats);
         Int32Proxy.Serialize(memoryStream, instance.MachineGunTotalDamageDone);
         Int32Proxy.Serialize(memoryStream, instance.MachineGunTotalShotsFired);
         Int32Proxy.Serialize(memoryStream, instance.MachineGunTotalShotsHit);
         Int32Proxy.Serialize(memoryStream, instance.MachineGunTotalSplats);
         Int32Proxy.Serialize(memoryStream, instance.MeleeTotalDamageDone);
         Int32Proxy.Serialize(memoryStream, instance.MeleeTotalShotsFired);
         Int32Proxy.Serialize(memoryStream, instance.MeleeTotalShotsHit);
         Int32Proxy.Serialize(memoryStream, instance.MeleeTotalSplats);
         Int32Proxy.Serialize(memoryStream, instance.ShotgunTotalDamageDone);
         Int32Proxy.Serialize(memoryStream, instance.ShotgunTotalShotsFired);
         Int32Proxy.Serialize(memoryStream, instance.ShotgunTotalShotsHit);
         Int32Proxy.Serialize(memoryStream, instance.ShotgunTotalSplats);
         Int32Proxy.Serialize(memoryStream, instance.SniperTotalDamageDone);
         Int32Proxy.Serialize(memoryStream, instance.SniperTotalShotsFired);
         Int32Proxy.Serialize(memoryStream, instance.SniperTotalShotsHit);
         Int32Proxy.Serialize(memoryStream, instance.SniperTotalSplats);
         Int32Proxy.Serialize(memoryStream, instance.SplattergunTotalDamageDone);
         Int32Proxy.Serialize(memoryStream, instance.SplattergunTotalShotsFired);
         Int32Proxy.Serialize(memoryStream, instance.SplattergunTotalShotsHit);
         Int32Proxy.Serialize(memoryStream, instance.SplattergunTotalSplats);
         memoryStream.WriteTo(stream);
     }
 }
    // Token: 0x06000C2F RID: 3119 RVA: 0x00051484 File Offset: 0x0004F684
    private void UpdateWeaponStatList()
    {
        this._weaponStatList.Clear();
        PlayerWeaponStatisticsView weaponStatistics = Singleton <PlayerDataManager> .Instance.ServerLocalPlayerStatisticsView.WeaponStatistics;

        switch (this._selectedFilterIndex)
        {
        case 0:
            this._weaponStatList.Add((float)weaponStatistics.MeleeTotalDamageDone, LocalizedStrings.MeleeWeapons);
            this._weaponStatList.Add((float)weaponStatistics.MachineGunTotalDamageDone, LocalizedStrings.Machineguns);
            this._weaponStatList.Add((float)weaponStatistics.CannonTotalDamageDone, LocalizedStrings.Cannons);
            this._weaponStatList.Add((float)weaponStatistics.ShotgunTotalDamageDone, LocalizedStrings.Shotguns);
            this._weaponStatList.Add((float)weaponStatistics.SplattergunTotalDamageDone, LocalizedStrings.Splatterguns);
            this._weaponStatList.Add((float)weaponStatistics.LauncherTotalDamageDone, LocalizedStrings.Launchers);
            this._weaponStatList.Add((float)weaponStatistics.SniperTotalDamageDone, LocalizedStrings.SniperRifles);
            this._currentStatsType = StatsPageGUI.StatisticValueType.Counter;
            break;

        case 1:
            this._weaponStatList.Add((float)weaponStatistics.MeleeTotalSplats, LocalizedStrings.MeleeWeapons);
            this._weaponStatList.Add((float)weaponStatistics.MachineGunTotalSplats, LocalizedStrings.Machineguns);
            this._weaponStatList.Add((float)weaponStatistics.CannonTotalSplats, LocalizedStrings.Cannons);
            this._weaponStatList.Add((float)weaponStatistics.ShotgunTotalSplats, LocalizedStrings.Shotguns);
            this._weaponStatList.Add((float)weaponStatistics.SplattergunTotalSplats, LocalizedStrings.Splatterguns);
            this._weaponStatList.Add((float)weaponStatistics.LauncherTotalSplats, LocalizedStrings.Launchers);
            this._weaponStatList.Add((float)weaponStatistics.SniperTotalSplats, LocalizedStrings.SniperRifles);
            this._currentStatsType = StatsPageGUI.StatisticValueType.Counter;
            break;

        case 2:
            this._weaponStatList.Add((weaponStatistics.MeleeTotalShotsHit != 0) ? (Mathf.Clamp01((float)weaponStatistics.MeleeTotalShotsHit / (float)weaponStatistics.MeleeTotalShotsFired) * 100f) : 0f, LocalizedStrings.MeleeWeapons);
            this._weaponStatList.Add((weaponStatistics.MachineGunTotalShotsHit != 0) ? (Mathf.Clamp01((float)weaponStatistics.MachineGunTotalShotsHit / (float)weaponStatistics.MachineGunTotalShotsFired) * 100f) : 0f, LocalizedStrings.Machineguns);
            this._weaponStatList.Add((weaponStatistics.CannonTotalShotsHit != 0) ? (Mathf.Clamp01((float)weaponStatistics.CannonTotalShotsHit / (float)weaponStatistics.CannonTotalShotsFired) * 100f) : 0f, LocalizedStrings.Cannons);
            this._weaponStatList.Add((weaponStatistics.ShotgunTotalShotsHit != 0) ? (Mathf.Clamp01((float)weaponStatistics.ShotgunTotalShotsHit / (float)weaponStatistics.ShotgunTotalShotsFired) * 100f) : 0f, LocalizedStrings.Shotguns);
            this._weaponStatList.Add((weaponStatistics.SplattergunTotalShotsHit != 0) ? (Mathf.Clamp01((float)weaponStatistics.SplattergunTotalShotsHit / (float)weaponStatistics.SplattergunTotalShotsFired) * 100f) : 0f, LocalizedStrings.Splatterguns);
            this._weaponStatList.Add((weaponStatistics.LauncherTotalShotsHit != 0) ? (Mathf.Clamp01((float)weaponStatistics.LauncherTotalShotsHit / (float)weaponStatistics.LauncherTotalShotsFired) * 100f) : 0f, LocalizedStrings.Launchers);
            this._weaponStatList.Add((weaponStatistics.SniperTotalShotsHit != 0) ? (Mathf.Clamp01((float)weaponStatistics.SniperTotalShotsHit / (float)weaponStatistics.SniperTotalShotsFired) * 100f) : 0f, LocalizedStrings.SniperRifles);
            this._currentStatsType = StatsPageGUI.StatisticValueType.Percent;
            break;

        case 3:
            this._weaponStatList.Add((float)weaponStatistics.MeleeTotalShotsHit, LocalizedStrings.MeleeWeapons);
            this._weaponStatList.Add((float)weaponStatistics.MachineGunTotalShotsHit, LocalizedStrings.Machineguns);
            this._weaponStatList.Add((float)weaponStatistics.CannonTotalShotsHit, LocalizedStrings.Cannons);
            this._weaponStatList.Add((float)weaponStatistics.ShotgunTotalShotsHit, LocalizedStrings.Shotguns);
            this._weaponStatList.Add((float)weaponStatistics.SplattergunTotalShotsHit, LocalizedStrings.Splatterguns);
            this._weaponStatList.Add((float)weaponStatistics.LauncherTotalShotsHit, LocalizedStrings.Launchers);
            this._weaponStatList.Add((float)weaponStatistics.SniperTotalShotsHit, LocalizedStrings.SniperRifles);
            this._currentStatsType = StatsPageGUI.StatisticValueType.Counter;
            break;
        }
        this._weaponStatList.Sort((KeyValuePair <float, string> a, KeyValuePair <float, string> b) => - a.Key.CompareTo(b.Key));
        this._maxWeaponStat = 0f;
        foreach (KeyValuePair <float, string> keyValuePair in this._weaponStatList)
        {
            if (keyValuePair.Key > this._maxWeaponStat)
            {
                this._maxWeaponStat = keyValuePair.Key;
            }
        }
    }