pub struct Location { /* private fields */ }Expand description
Represents a player’s geographic location as recorded in the ghost file header, consisting of a country, subregion, and regions version.
Implementations§
Source§impl Location
impl Location
Sourcepub fn find(
country_id: u8,
subregion_id: u8,
version: Option<Version>,
) -> Option<Location>
pub fn find( country_id: u8, subregion_id: u8, version: Option<Version>, ) -> Option<Location>
Looks up a Location by country ID, subregion ID, and optional region version.
If version is None, the lookup may return an adjusted match (i.e. the
closest valid location). Both exact and adjusted matches are returned as Some.
Returns None if no matching location can be found.
§Arguments
country_id- The numeric country identifier.subregion_id- The numeric subregion identifier.version- An optional region version to constrain the lookup.
Sourcepub fn find_exact(
country_id: u8,
subregion_id: u8,
version: Version,
) -> Option<Location>
pub fn find_exact( country_id: u8, subregion_id: u8, version: Version, ) -> Option<Location>
Looks up a Location by country ID, subregion ID, and exact version.
Unlike Location::find, this only returns Some when the lookup produces
an exact match. Adjusted matches and missing entries both return None.
§Arguments
country_id- The numeric country identifier.subregion_id- The numeric subregion identifier.version- The region version that must match exactly.
Sourcepub fn change_version(&self, version: Version) -> Option<Self>
pub fn change_version(&self, version: Version) -> Option<Self>
Returns a new Location with the same country and subregion but a different version.
Returns None if no exact location entry exists for this country/subregion
combination under the requested version.
§Arguments
version- The new region version to look up for this location’s country ID and subregion ID.