55 lines
1.8 KiB
C#
55 lines
1.8 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace NeonSprawl.Server.Game.Npc;
|
|
|
|
/// <summary>JSON body for <c>GET /game/world/npc-runtime-snapshot</c> (NEO-94).</summary>
|
|
public sealed class NpcRuntimeSnapshotResponse
|
|
{
|
|
public const int CurrentSchemaVersion = 1;
|
|
|
|
[JsonPropertyName("schemaVersion")]
|
|
public int SchemaVersion { get; init; } = CurrentSchemaVersion;
|
|
|
|
[JsonPropertyName("serverTimeUtc")]
|
|
public DateTimeOffset ServerTimeUtc { get; init; }
|
|
|
|
/// <summary>Prototype NPC runtime rows ordered by ascending <c>npcInstanceId</c>.</summary>
|
|
[JsonPropertyName("npcInstances")]
|
|
public required IReadOnlyList<NpcInstanceRuntimeJson> NpcInstances { get; init; }
|
|
}
|
|
|
|
/// <summary>One row in the NPC runtime snapshot projection.</summary>
|
|
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; }
|
|
}
|
|
|
|
/// <summary>Active telegraph nested on an NPC row during <c>telegraph_windup</c>.</summary>
|
|
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; }
|
|
}
|