pub struct Repository {
pub name: String,
pub platform: Platform,
pub repo_type: RepositoryType,
pub version: Option<String>,
}
Expand description
Encapsulates a directory of game data, such as “ex1”. This data is also versioned.
This handles calculating the correct dat and index filenames, mainly for GameData
.
Fields§
§name: String
The folder name, such as “ex1”.
platform: Platform
The platform this repository is designed for.
repo_type: RepositoryType
The type of repository, such as “base game” or “expansion”.
version: Option<String>
The version of the game data.
Implementations§
Source§impl Repository
impl Repository
Sourcepub fn from_existing_base(platform: Platform, dir: &str) -> Option<Repository>
pub fn from_existing_base(platform: Platform, dir: &str) -> Option<Repository>
Creates a new base Repository
, from an existing directory. This may return None
if
the directory is invalid, e.g. a version file is missing.
Sourcepub fn from_existing_expansion(
platform: Platform,
dir: &str,
) -> Option<Repository>
pub fn from_existing_expansion( platform: Platform, dir: &str, ) -> Option<Repository>
Creates a new expansion Repository
, from an existing directory. This may return None
if
the directory is invalid, e.g. a version file is missing.
Sourcepub fn index_filename(&self, chunk: u8, category: Category) -> String
pub fn index_filename(&self, chunk: u8, category: Category) -> String
Calculate an index filename for a specific category, like “0a0000.win32.index”.
Sourcepub fn index2_filename(&self, chunk: u8, category: Category) -> String
pub fn index2_filename(&self, chunk: u8, category: Category) -> String
Calculate an index2 filename for a specific category, like “0a0000.win32.index”.
Trait Implementations§
Source§impl Clone for Repository
impl Clone for Repository
Source§fn clone(&self) -> Repository
fn clone(&self) -> Repository
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more