1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-07 21:58:06 -05:00
IW4M-Admin/Plugins/Stats/Helpers/WeaponNameExtensions.cs
2024-07-02 16:23:36 -05:00

21 lines
667 B
C#

using System.Linq;
using Data.Models.Client.Stats;
namespace Stats.Helpers
{
public static class WeaponNameExtensions
{
public static string RebuildWeaponName(this EFClientHitStatistic stat)
{
var attachments =
new[]
{
stat.WeaponAttachmentCombo?.Attachment1?.Name, stat.WeaponAttachmentCombo?.Attachment2?.Name,
stat.WeaponAttachmentCombo?.Attachment3?.Name
}.Where(a => !string.IsNullOrEmpty(a));
return $"{stat.Weapon?.Name?.Replace("zombie_", "").Replace("_zombie", "")}{string.Join("_", attachments)}";
}
}
}