예제 #1
0
 private static string ToTreeFormat(string text, Dictionary <ElementType, Func <object, Formatter.Tag> > translations)
 {
     return(Formatter.ToTreeFormat(Formatter.Parse(text), translations));
 }
예제 #2
0
 public static string ToPlaintext(string text)
 {
     return(Formatter.ToTreeFormat(text, new Dictionary <ElementType, Func <object, Formatter.Tag> >()));
 }
예제 #3
0
        public static string ToTerraria(string text)
        {
            string str = text;
            Dictionary <ElementType, Func <object, Formatter.Tag> > elementTypes = new Dictionary <ElementType, Func <object, Formatter.Tag> >();

            elementTypes[ElementType.Color] = (object c) => new Formatter.Tag(string.Concat("[c/", Formatter.RGBAtoRGB(c), ":"), "]");
            return(Formatter.ToTreeFormat(str, elementTypes));
        }
예제 #4
0
 public static List <Element> Parse(string text)
 {
     return(Formatter.Parse(Formatter.Lexer.Lex(text)));
 }