// =================== Implementations below ===================== private void HandleCommand(ChatRuntime cm, ChatEvent e) { Command c = e.Command; if (c is Do || c is Chat || c is Meta) // just info in this context { suffix += " [" + c.TypeName() + ": " + c.Text + "]"; } else if (c is Ask) { Ask a = ((Ask)c); string sec = a.WaitSecs > 0 ? " #" + a.WaitSecs + "s" : ""; Out.WriteLine(c.Text + sec + suffix); suffix = ""; cm.Do(Prompt(a)); } else if (!(c is Wait || c is Opt || c is Go || c is Set)) { Out.WriteLine(c.Text + suffix); suffix = ""; } }