using System.Text.Json.Serialization;
namespace NeonSprawl.Server.Game.Npc;
/// JSON body for GET /game/world/npc-runtime-snapshot (NEO-94).
public sealed class NpcRuntimeSnapshotResponse
{
public const int CurrentSchemaVersion = 1;
[JsonPropertyName("schemaVersion")]
public int SchemaVersion { get; init; } = CurrentSchemaVersion;
[JsonPropertyName("serverTimeUtc")]
public DateTimeOffset ServerTimeUtc { get; init; }
/// Prototype NPC runtime rows ordered by ascending npcInstanceId.
[JsonPropertyName("npcInstances")]
public required IReadOnlyList NpcInstances { get; init; }
}
/// One row in the NPC runtime snapshot projection.
public sealed class NpcInstanceRuntimeJson
{
[JsonPropertyName("npcInstanceId")]
public required string NpcInstanceId { get; init; }
[JsonPropertyName("behaviorDefId")]
public required string BehaviorDefId { get; init; }
[JsonPropertyName("state")]
public required string State { get; init; }
[JsonPropertyName("aggroHolderPlayerId")]
public string? AggroHolderPlayerId { get; init; }
[JsonPropertyName("activeTelegraph")]
public ActiveTelegraphJson? ActiveTelegraph { get; init; }
}
/// Active telegraph nested on an NPC row during telegraph_windup.
public sealed class ActiveTelegraphJson
{
[JsonPropertyName("telegraphId")]
public required string TelegraphId { get; init; }
[JsonPropertyName("npcInstanceId")]
public required string NpcInstanceId { get; init; }
[JsonPropertyName("windupRemainingSeconds")]
public required double WindupRemainingSeconds { get; init; }
[JsonPropertyName("archetypeKind")]
public required string ArchetypeKind { get; init; }
}