pub(crate) fn main() -> Result<(), UserError>
Expand description
Main function. This is the entry point of the program.
§Process
- Reads user input through the command line arguments or prompts the user for input.
- Parses the save file.
- Initializes a SaveFile object using the provided file name
- Iterates over the Section objects in the save file
If the section is of interest to us (e.g.
living
,dead_unprunable
, etc.):- We parse the section into SaveFileObject objects
- We parse the objects into Derived objects
- We store the objects in the GameState object
- Initializes a [minijinja::Environment] and loads the templates from the
templates
folder - Foreach encountered structures::Player in game:
- Creates a folder with the player’s name
- Renders the objects into HTML using the templates and writes them to the folder
- Prints the time taken to parse the save file