Retry a failed portrait from the notice with the same scene builder.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-21 01:48:30 +03:00
co-authored by Cursor
parent 3c70227229
commit 3061e09d3e
32 changed files with 712 additions and 105 deletions
+32 -1
View File
@@ -29,9 +29,14 @@ internal abstract record WorkerCommand
/// <summary>Test/dev post onto the school board. Looks up an EventDef by name.</summary>
internal sealed record PostNotice(
string DefName,
uint PersonId,
string PersonKey,
string Kind,
TaskCompletionSource<PostedNotice?> Result) : WorkerCommand;
internal sealed record GetNoticePortraitTarget(
uint NoticeId,
TaskCompletionSource<NoticePortraitTarget> Result) : WorkerCommand;
internal sealed record Dump(TaskCompletionSource<SchoolLiveDump?> Result) : WorkerCommand;
internal sealed record GetPerson(
@@ -96,3 +101,29 @@ internal abstract record WorkerCommand
}
internal sealed record PostedNotice(uint Id, string DefName, bool Pause);
internal enum NoticePortraitTargetError
{
None,
UnknownSchool,
UnknownNotice,
CannotGenerate,
}
internal sealed record NoticePortraitTarget(
NoticePortraitTargetError Error,
string PersonId,
PortraitKind Kind)
{
public static NoticePortraitTarget UnknownSchool { get; } =
new(NoticePortraitTargetError.UnknownSchool, "", PortraitKind.Full);
public static NoticePortraitTarget UnknownNotice { get; } =
new(NoticePortraitTargetError.UnknownNotice, "", PortraitKind.Full);
public static NoticePortraitTarget CannotGenerate { get; } =
new(NoticePortraitTargetError.CannotGenerate, "", PortraitKind.Full);
public static NoticePortraitTarget Ok(string personId, PortraitKind kind) =>
new(NoticePortraitTargetError.None, personId, kind);
}