fix: add original_path property to GameSaveLocation

This commit is contained in:
2021-03-01 21:27:22 -06:00
parent 71d4fb91d7
commit 5cf660666a
2 changed files with 7 additions and 2 deletions

View File

@@ -12,14 +12,19 @@ const XXHASH64_SEED: u64 = 1337;
#[derive(Debug, Clone)]
pub struct GameSaveLocation {
pub friendly_name: Option<String>,
pub original_path: PathBuf,
files: Vec<GameFile>,
uuid: Uuid,
}
impl GameSaveLocation {
pub fn new(files: Vec<GameFile>, friendly_name: Option<String>) -> Self {
pub fn new<P>(path: P, files: Vec<GameFile>, friendly_name: Option<String>) -> Self
where
P: AsRef<Path>,
{
Self {
friendly_name,
original_path: path.as_ref().to_path_buf(),
files,
uuid: Uuid::new_v4(),
}