Class StoryFileWriter

java.lang.Object
edu.ntnu.idatt2001.paths.file.StoryFileWriter

public class StoryFileWriter extends Object
Class for writing a story to a file.
Version:
0.4 29.04.2023
Author:
Carl G. Callum G.
  • Constructor Details

  • Method Details

    • writeStory

      public void writeStory(Story story) throws IOException
      Method to write a story to a file. Writes in the following format:
       StoryTitle
      
       ::PassageTitle
       PassageContent
       [LinkText](LinkReference)<Action1|Action2|...>
      
       ::PassageTitle
       PassageContent
       [LinkText](LinkReference)<Action1|Action2|...>
      
       
      Parameters:
      story - Story - the story to write
      Throws:
      IOException - if an error occurs while writing to the file
    • getFile

      public File getFile()
      Method to get the file.
      Returns:
      File - the file