// Return info for when a new event occurs public EventDatum GetEvent() { int idx = Random.Range(0, event_list.Count); EventDatum my_event = event_list[idx]; // Events may only occur once per game event_list.RemoveAt(idx); return(my_event); }
// Load events from input text file public void GetEventData(string path) { // Read from file StreamReader reader = new StreamReader(path); string text = ""; while (true) { text = reader.ReadLine(); // While there is stuff to read if (text != null) { // name, stat_name, stat_value, desc, opt_1, opt_2, img.name var datum = new EventDatum(text.Split('*')); event_list.Add(datum); ///civilians[i] = new CharacterData(values[0], values[1], values[2]); } // End of the file else { break; } } }