/// <summary> Writes the contents of this AICCollection into the stream in ASCII text encoding.</summary> public void Write(Stream stream) { using (AIWriter aiw = new AIWriter(stream)) { aiw.Write(header); aiw.WriteLine(); aiw.OpenCommentSec(); aiw.WriteInfo(typeof(AICharacter)); aiw.CloseCommentSec(); aiw.WriteLine(); foreach (AICharacter c in this.Values.OrderBy(c => c.Index)) { aiw.Write(c); aiw.WriteLine(); } } }
/// <summary> Writes the contents of this AICCollection into the stream in ASCII text encoding.</summary> public void Write(Stream stream) { using (AIWriter aiw = new AIWriter(stream)) { foreach (AICharacter c in this.Values) { aiw.Write(c); aiw.WriteLine(); } } }
static void WriteString(AIWriter w, string name, object o) { string input = (string)o; if (!input.Contains('\n')) { WriteDefault(w, name, o); return; } w.WriteLine(name); w.OpenSec(); string[] lines = input.Split(lineBreakArr, StringSplitOptions.None); foreach (string line in lines) { w.WriteLine(line); } w.CloseSec(); }
static void WriteDefault(AIWriter w, string name, object o) { w.WriteLine(string.Format("{0}\t= {1}", name, o)); }