/** * Loads and parses given file. * * @param fileName Path to the file to be read. In the form to be accepted by {@link * java.io.FileReader} * @throws RuntimeException if something went wrong with reading the file */ public void load(String fileName) { String text = ""; try { BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(fileName), "UTF-8")); String line; while ((line = reader.readLine()) != null) text += line + "\n"; } catch (Exception e) { throw new RuntimeException("Could not load scenarios file.", e); } loader.loadFrom(text); }
/** * Accessor to {@link StoryModel} representing the loaded scenarios file. * * @return Parsed StoryModel (with scenarios, etc.) */ public List<StoryModel> stories() { return loader.stories(); }