42 lines
1.5 KiB
C#
42 lines
1.5 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace NeonSprawl.Server.Game.Encounters;
|
|
|
|
/// <summary>JSON body for <c>GET /game/players/{{id}}/encounter-progress</c> (NEO-108).</summary>
|
|
public sealed class EncounterProgressListResponse
|
|
{
|
|
public const int CurrentSchemaVersion = 1;
|
|
|
|
[JsonPropertyName("schemaVersion")]
|
|
public int SchemaVersion { get; init; } = CurrentSchemaVersion;
|
|
|
|
[JsonPropertyName("playerId")]
|
|
public required string PlayerId { get; init; }
|
|
|
|
/// <summary>Per-player rows ordered by catalog encounter <c>id</c> (ordinal).</summary>
|
|
[JsonPropertyName("encounters")]
|
|
public required IReadOnlyList<EncounterProgressRowJson> Encounters { get; init; }
|
|
}
|
|
|
|
/// <summary>Authoritative per-player progress for one encounter definition.</summary>
|
|
public sealed class EncounterProgressRowJson
|
|
{
|
|
[JsonPropertyName("encounterId")]
|
|
public required string EncounterId { get; init; }
|
|
|
|
/// <summary><c>inactive</c>, <c>active</c>, or <c>completed</c>.</summary>
|
|
[JsonPropertyName("state")]
|
|
public required string State { get; init; }
|
|
|
|
[JsonPropertyName("defeatedTargetIds")]
|
|
public required IReadOnlyList<string> DefeatedTargetIds { get; init; }
|
|
|
|
[JsonPropertyName("completedAt")]
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public DateTimeOffset? CompletedAt { get; init; }
|
|
|
|
[JsonPropertyName("rewardGrantSummary")]
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public IReadOnlyList<EncounterRewardGrantJson>? RewardGrantSummary { get; init; }
|
|
}
|