using System.Text.Json.Serialization; namespace NeonSprawl.Server.Game.AbilityInput; /// GET response for per-slot cooldown ends (NEO-32). public sealed class CooldownSnapshotResponse { public const int CurrentSchemaVersion = 1; [JsonPropertyName("schemaVersion")] public int SchemaVersion { get; init; } = CurrentSchemaVersion; [JsonPropertyName("playerId")] public required string PlayerId { get; init; } /// Authoritative instant for remaining-time math on the client. [JsonPropertyName("serverTimeUtc")] public DateTimeOffset ServerTimeUtc { get; init; } /// Slots 0..7 in ascending order. [JsonPropertyName("slots")] public required IReadOnlyList Slots { get; init; } } /// Cooldown end for one hotbar slot; null when ready. public sealed class CooldownSlotSnapshotJson { [JsonPropertyName("slotIndex")] public required int SlotIndex { get; init; } /// UTC instant when the slot leaves cooldown, or null when not cooling. [JsonPropertyName("cooldownEndsAtUtc")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public DateTimeOffset? CooldownEndsAtUtc { get; init; } }