1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-07-05 10:06:28 +02:00
MLEM/MLEM.Ui/Format/FormattingCode.cs

49 lines
1,017 B
C#

using System;
using Microsoft.Xna.Framework;
using MLEM.Textures;
namespace MLEM.Ui.Format {
public class FormattingCode {
public readonly Type CodeType;
public readonly Color Color;
public readonly TextStyle Style;
public readonly TextureRegion Icon;
public FormattingCode(Color color) {
this.Color = color;
this.CodeType = Type.Color;
}
public FormattingCode(TextStyle style) {
this.Style = style;
this.CodeType = Type.Style;
}
public FormattingCode(TextureRegion icon) {
this.Icon = icon;
this.CodeType = Type.Icon;
}
public string GetReplacementString() {
return this.CodeType == Type.Icon ? TextFormatting.OneEmString : string.Empty;
}
public enum Type {
Color,
Style,
Icon
}
}
public enum TextStyle {
Regular,
Bold,
Italic
}
}