Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

rakaly/imperator-save

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ci Version

Imperator Save

Imperator Save is a library to ergonomically work with Imperator Rome saves (debug + standard).

use imperator_save::{ImperatorFile, models::Save, BasicTokenResolver};

// Load the file
let file_path = "assets/saves/observer1.5.rome";
let mut file = ImperatorFile::from_file(std::fs::File::open(file_path)?)?;

// Create a token resolver (for binary saves)
// Note: For ironman saves, you need the actual token data
let tokens = BasicTokenResolver::from_text_lines(b"").unwrap();

// Parse the save
let save = Save::from_file(&mut file, &tokens)?;
assert_eq!(save.meta.version, String::from("1.5.3"));
# Ok::<(), Box<dyn std::error::Error>>(())

Ironman

Ironman saves are supported through a provided TokenResolver. Per PDS counsel, the data to construct such a TokenResolver is not distributed here.

About

Ergonomically work with Imperator Rome saves

Topics

Resources

License

Stars

Watchers

Forks

Languages