give revs briefing (#20749)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-10-05 16:05:09 +01:00
committed by GitHub
parent 14256dee03
commit a365568a7a
4 changed files with 42 additions and 11 deletions

View File

@@ -35,4 +35,28 @@ public sealed class RoleSystem : SharedRoleSystem
/// Handlers can either replace or append to the briefing, whichever is more appropriate.
/// </summary>
[ByRefEvent]
public record struct GetBriefingEvent(string? Briefing = null);
public sealed class GetBriefingEvent
{
public string? Briefing;
public GetBriefingEvent(string? briefing = null)
{
Briefing = briefing;
}
/// <summary>
/// If there is no briefing, sets it to the string.
/// If there is a briefing, adds a new line to separate it from the appended string.
/// </summary>
public void Append(string text)
{
if (Briefing == null)
{
Briefing = text;
}
else
{
Briefing += "\n" + text;
}
}
}