void Start() { db = GlobalVars.database; db.AddCharacter(new CharacterData("You")); CharacterData cd = new CharacterData("Sally"); cd.AddTopic(new TopicData("Cookies",topic)); cd.AddAvaliableTopic(0); db.AddCharacter(cd); }
private void ProcessTopicList(string fileName, ref CharacterData charTemp) { StreamReader file = new StreamReader(ROOT_PATH + fileName, Encoding.Default); if (file != null) { LoadTopic lt = new LoadTopic(); TopicData td = null; int i = 0; string line; do { line = file.ReadLine(); if (line != null) { if (line[0] == '{') { bool done = false; string PlotID = null; do { line = file.ReadLine(); if (line == null) done = true; else if (line[0] == '}') done = true; else { string[] elements = line.Split('='); if (elements.Length == 2) { if (elements[0] == "plot_marker") { PlotID = elements[1]; } } else { lt.Load(ROOT_PATH + line); td = lt.GetTopicData(); if (td != null) { charTemp.AddTopic(td); if (PlotID != null) { charTemp.AddPlotTopic(PlotID, i); i++; } } } } } while (!done); } } } while (line != null); } }