1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-17 19:20:07 +01:00
MLEM/MLEM.Ui/Format/FormattingCode.cs

49 lines
1,017 B
C#
Raw Normal View History

using System;
2019-08-24 00:07:54 +02:00
using Microsoft.Xna.Framework;
using MLEM.Textures;
2019-08-24 00:07:54 +02:00
namespace MLEM.Ui.Format {
public class FormattingCode {
public readonly Type CodeType;
2019-08-24 00:07:54 +02:00
public readonly Color Color;
public readonly TextStyle Style;
public readonly TextureRegion Icon;
2019-08-24 00:07:54 +02:00
public FormattingCode(Color color) {
this.Color = color;
this.CodeType = Type.Color;
2019-08-24 00:07:54 +02:00
}
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
2019-08-24 00:07:54 +02:00
}
}
public enum TextStyle {
Regular,
Bold,
Italic
}
}