mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-01 16:47:26 +00:00
* pt1 damageable refactor * fixes * thusd unused * sparse damagespecifiers * fix thongs * aaaaaa * fix tests * de-crash
21 lines
606 B
C#
21 lines
606 B
C#
using System.Text.Json;
|
|
using Content.Shared.Damage;
|
|
using Robust.Shared.Map;
|
|
using Robust.Shared.Map.Components;
|
|
|
|
namespace Content.Server.Administration.Logs.Converters;
|
|
|
|
[AdminLogConverter]
|
|
public sealed class DamageSpecifierConverter : AdminLogConverter<DamageSpecifier>
|
|
{
|
|
public override void Write(Utf8JsonWriter writer, DamageSpecifier value, JsonSerializerOptions options)
|
|
{
|
|
writer.WriteStartObject();
|
|
foreach (var (damage, amount) in value.DamageDict)
|
|
{
|
|
writer.WriteNumber(damage.Id, amount.Double());
|
|
}
|
|
writer.WriteEndObject();
|
|
}
|
|
}
|