mirror of
https://github.com/Dongyifengs/AssetStudio-Genshin-MoYi.git
synced 2025-05-07 20:09:19 +08:00
41 lines
820 B
C#
41 lines
820 B
C#
|
namespace AssetStudio
|
|||
|
{
|
|||
|
public abstract class YAMLNode
|
|||
|
{
|
|||
|
internal virtual void Emit(Emitter emitter)
|
|||
|
{
|
|||
|
bool isWrote = false;
|
|||
|
if (!CustomTag.IsEmpty)
|
|||
|
{
|
|||
|
emitter.Write(CustomTag.ToString()).WriteWhitespace();
|
|||
|
isWrote = true;
|
|||
|
}
|
|||
|
if (Anchor.Length > 0)
|
|||
|
{
|
|||
|
emitter.Write("&").Write(Anchor).WriteWhitespace();
|
|||
|
isWrote = true;
|
|||
|
}
|
|||
|
|
|||
|
if (isWrote)
|
|||
|
{
|
|||
|
if (IsMultiline)
|
|||
|
{
|
|||
|
emitter.WriteLine();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public abstract YAMLNodeType NodeType { get; }
|
|||
|
public abstract bool IsMultiline { get; }
|
|||
|
public abstract bool IsIndent { get; }
|
|||
|
|
|||
|
public string Tag
|
|||
|
{
|
|||
|
get => CustomTag.Content;
|
|||
|
set => CustomTag = new YAMLTag(YAMLWriter.DefaultTagHandle, value);
|
|||
|
}
|
|||
|
public YAMLTag CustomTag { get; set; }
|
|||
|
public string Anchor { get; set; } = string.Empty;
|
|||
|
}
|
|||
|
}
|