Table of Contents

Class SpeechFragment

Namespace
DialogueDown.Playbook.Speech
Assembly
DialogueDown.Playbook.dll

One piece of what a line says. Speech is a list of these rather than a string, because a host renders it: Godot as BBCode, the report as HTML, a terminal as ANSI.

[JsonPolymorphic(TypeDiscriminatorPropertyName = "kind")]
[JsonDerivedType(typeof(TextFragment), "text")]
[JsonDerivedType(typeof(StyledTextFragment), "styled")]
[JsonDerivedType(typeof(LinkFragment), "link")]
[JsonDerivedType(typeof(ImageFragment), "image")]
[JsonDerivedType(typeof(LineBreakFragment), "break")]
[JsonDerivedType(typeof(QueryFragment), "query")]
[JsonDerivedType(typeof(DefaultCommandFragment), "default-command")]
[JsonDerivedType(typeof(CustomCommandFragment), "custom-command")]
[JsonDerivedType(typeof(TagFragment), "tag")]
public abstract record SpeechFragment : IEquatable<SpeechFragment>
Inheritance
SpeechFragment
Implements
Derived
Inherited Members

Remarks

Fragments nest — styling wraps more fragments — so the encoding is recursive. Each is tagged with a kind, and the union is closed to the kinds listed here.