public void AddChild(ushort chapterIndex, byte choice) { while (ChildChapters.Count <= choice) { ChildChapters.Add(0xFFFF); } ChildChapters[choice] = chapterIndex; }
public void Update(Chapter updatedChapter) { if (updatedChapter.Title != "") { Title = updatedChapter.Title; } if (updatedChapter.Author != "") { Author = updatedChapter.Author; } if (updatedChapter.ChoiceNum != 0xFF) { ChoiceNum = updatedChapter.ChoiceNum; } if (updatedChapter.ParentChapter != 0xFFFF) { ParentChapter = updatedChapter.ParentChapter; } if (updatedChapter.Text != "") { Text = updatedChapter.Text; } while (ChildChapters.Count < updatedChapter.ChildChapters.Count) { ChildChapters.Add(0xFFFF); } for (int i = 0; i < updatedChapter.ChildChapters.Count; i++) { if (updatedChapter.ChildChapters[i] != 0xFFFF) { ChildChapters[i] = updatedChapter.ChildChapters[i]; } } while (ChoiceDescriptions.Count < updatedChapter.ChoiceDescriptions.Count) { ChoiceDescriptions.Add(""); } for (int i = 0; i < updatedChapter.ChoiceDescriptions.Count; i++) { if (updatedChapter.ChoiceDescriptions[i] != "") { ChoiceDescriptions[i] = updatedChapter.ChoiceDescriptions[i]; } } }