1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-05-15 05:38:46 +02:00
MLEM/MLEM/Formatting/Codes/FontCode.cs
2022-06-17 18:23:47 +02:00

28 lines
700 B
C#

using System;
using System.Text.RegularExpressions;
using MLEM.Font;
namespace MLEM.Formatting.Codes {
/// <inheritdoc />
public class FontCode : Code {
private readonly Func<GenericFont, GenericFont> font;
/// <inheritdoc />
public FontCode(Match match, Regex regex, Func<GenericFont, GenericFont> font) : base(match, regex) {
this.font = font;
}
/// <inheritdoc />
public override GenericFont GetFont(GenericFont defaultPick) {
return this.font?.Invoke(defaultPick);
}
/// <inheritdoc />
public override bool EndsHere(Code other) {
return other is FontCode;
}
}
}