using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace TheSlimesJourney { public class Event { public string description = "You could try something random."; public string[] requirements = null; public string[] script; public Event(string filename) { StreamReader sr = new StreamReader("events/" + filename + ".sje"); while (!sr.EndOfStream) { string currentLine = Utils.Filter(sr.ReadLine()); switch (currentLine) { case "event": sr.ReadLine(); //Skip the { while (currentLine != "}") { currentLine = Utils.Filter(sr.ReadLine()); switch (currentLine) { case "requirements": { requirements = Utils.ReadScope(sr); } break; case "short": { StringBuilder sb = new StringBuilder(); sr.ReadLine(); //Skip the { while (currentLine != "}") { currentLine = Utils.Filter(sr.ReadLine()); if (currentLine != "}") sb.Append(currentLine); } description = sb.ToString(); currentLine = ""; //So as not to trigger other scope ends } break; case "script": { script = Utils.ReadScope(sr); } break; } } break; } } sr.Close(); } } }