public void ShowCurrentText(IStory story, ConsoleUserInterfaceOptions options)
        {
            var writer = new Runtime.SimpleJson.Writer();

            writer.WriteObjectStart();
            writer.WriteProperty("text", story.currentText);
            writer.WriteObjectEnd();
            ConsoleInteractor.WriteJsonInformation(writer.ToString());
        }
 public void ShowOutputResult(InputInterpretationResult result, ConsoleUserInterfaceOptions options)
 {
     if (result.output != null)
     {
         var writer = new Runtime.SimpleJson.Writer();
         writer.WriteObjectStart();
         writer.WriteProperty("cmdOutput", result.output);
         writer.WriteObjectEnd();
         ConsoleInteractor.WriteJsonError(writer.ToString());
     }
 }
示例#3
0
        public void ShowStats(CommandLineToolOptions options, Stats stats)
        {
            var writer = new Runtime.SimpleJson.Writer();

            writer.WriteObjectStart();
            writer.WritePropertyStart("stats");

            writer.WriteObjectStart();
            writer.WriteProperty("words", stats.words);
            writer.WriteProperty("knots", stats.knots);
            writer.WriteProperty("stitches", stats.stitches);
            writer.WriteProperty("functions", stats.functions);
            writer.WriteProperty("choices", stats.choices);
            writer.WriteProperty("gathers", stats.gathers);
            writer.WriteProperty("diverts", stats.diverts);
            writer.WriteObjectEnd();

            writer.WritePropertyEnd();
            writer.WriteObjectEnd();

            ConsoleInteractor.WriteJsonInformation(writer.ToString());
        }