1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-06-26 14:41:41 +02:00
MLEM/MLEM/Formatting/Codes/FontCode.cs

27 lines
699 B
C#
Raw Normal View History

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