public ScriptBook(string title) { scriptText = new Dictionary <ChapterTitle, List <List <ScriptParagraph> > >(); chaptersOrdered = new Queue <ChapterTitle>(); currentChapter = new ChapterTitle("<no chapters added>", "<no subchapters added>"); Title = title; }
private Dictionary <int, ChapterTitle> getChapters(NameValueCollection parserChapters) { Dictionary <int, ChapterTitle> chapters = new Dictionary <int, ChapterTitle>(); int i = 1; foreach (string chapter in parserChapters) { var chapterParts = parserChapters[chapter].Split(';'); var chapterTitle = new ChapterTitle(chapterParts[0], chapterParts[1]); chapters.Add(i++, chapterTitle); } return(chapters); }
internal void AddChapter(ChapterTitle chapter) { if (scriptText.ContainsKey(chapter)) { throw new Exception("Chapter already exists!"); } else { scriptText[chapter] = new List <List <ScriptParagraph> >(); scriptText[chapter].Add(new List <ScriptParagraph>()); // initial section chaptersOrdered.Enqueue(chapter); currentChapter = chapter; } }