Function main

Source
pub(crate) fn main() -> Result<(), UserError>
Expand description

Main function. This is the entry point of the program.

§Process

  1. Reads user input through the command line arguments or prompts the user for input.
  2. Parses the save file.
    1. Initializes a SaveFile object using the provided file name
    2. Iterates over the Section objects in the save file If the section is of interest to us (e.g. living, dead_unprunable, etc.):
      1. We parse the section into SaveFileObject objects
      2. We parse the objects into Derived objects
      3. We store the objects in the GameState object
  3. Initializes a [minijinja::Environment] and loads the templates from the templates folder
  4. Foreach encountered structures::Player in game:
    1. Creates a folder with the player’s name
    2. Renders the objects into HTML using the templates and writes them to the folder
  5. Prints the time taken to parse the save file