コード例 #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)));
 }