pub struct BuildingLink { /* private fields */ }Expand description
Links a building instance to a prefab instance.
Building links establish relationships between buildings in the battlefield building list and their associated prefab instances. This allows buildings to reference prefab data for models, textures, and other assets.
§Fields
serialise_version: Format version (1-3)building_index: Index of the building in the building listprefab_index: Index of the prefab in the prefab listprefab_building_key: String key identifying the prefab buildinguid: Unique identifier for this building linkprefab_uid: Unique identifier of the associated prefabbuilding_reference: Reference data for the building
§Example
use rpfm_lib::files::bmd::common::building_link::BuildingLink;
let mut link = BuildingLink::default();
link.set_serialise_version(3);
link.set_building_index(5);
link.set_prefab_building_key("settlement_wall_01".to_string());Implementations§
Source§impl BuildingLink
impl BuildingLink
Sourcepub fn serialise_version(&self) -> &u16
pub fn serialise_version(&self) -> &u16
Format version number (1-3).
Sourcepub fn building_index(&self) -> &i32
pub fn building_index(&self) -> &i32
Index of the building in the building list.
Sourcepub fn prefab_index(&self) -> &i32
pub fn prefab_index(&self) -> &i32
Index of the prefab in the prefab list.
Sourcepub fn prefab_building_key(&self) -> &String
pub fn prefab_building_key(&self) -> &String
String key identifying the prefab building.
Sourcepub fn prefab_uid(&self) -> &u64
pub fn prefab_uid(&self) -> &u64
Unique identifier of the associated prefab.
Sourcepub fn building_reference(&self) -> &BuildingReference
pub fn building_reference(&self) -> &BuildingReference
Reference data for the building.
Source§impl BuildingLink
impl BuildingLink
Sourcepub fn serialise_version_mut(&mut self) -> &mut u16
pub fn serialise_version_mut(&mut self) -> &mut u16
Format version number (1-3).
Sourcepub fn building_index_mut(&mut self) -> &mut i32
pub fn building_index_mut(&mut self) -> &mut i32
Index of the building in the building list.
Sourcepub fn prefab_index_mut(&mut self) -> &mut i32
pub fn prefab_index_mut(&mut self) -> &mut i32
Index of the prefab in the prefab list.
Sourcepub fn prefab_building_key_mut(&mut self) -> &mut String
pub fn prefab_building_key_mut(&mut self) -> &mut String
String key identifying the prefab building.
Sourcepub fn prefab_uid_mut(&mut self) -> &mut u64
pub fn prefab_uid_mut(&mut self) -> &mut u64
Unique identifier of the associated prefab.
Sourcepub fn building_reference_mut(&mut self) -> &mut BuildingReference
pub fn building_reference_mut(&mut self) -> &mut BuildingReference
Reference data for the building.
Source§impl BuildingLink
impl BuildingLink
Sourcepub fn set_serialise_version(&mut self, val: u16) -> &mut Self
pub fn set_serialise_version(&mut self, val: u16) -> &mut Self
Format version number (1-3).
Sourcepub fn set_building_index(&mut self, val: i32) -> &mut Self
pub fn set_building_index(&mut self, val: i32) -> &mut Self
Index of the building in the building list.
Sourcepub fn set_prefab_index(&mut self, val: i32) -> &mut Self
pub fn set_prefab_index(&mut self, val: i32) -> &mut Self
Index of the prefab in the prefab list.
Sourcepub fn set_prefab_building_key(&mut self, val: String) -> &mut Self
pub fn set_prefab_building_key(&mut self, val: String) -> &mut Self
String key identifying the prefab building.
Sourcepub fn set_prefab_uid(&mut self, val: u64) -> &mut Self
pub fn set_prefab_uid(&mut self, val: u64) -> &mut Self
Unique identifier of the associated prefab.
Sourcepub fn set_building_reference(&mut self, val: BuildingReference) -> &mut Self
pub fn set_building_reference(&mut self, val: BuildingReference) -> &mut Self
Reference data for the building.
Trait Implementations§
Source§impl Clone for BuildingLink
impl Clone for BuildingLink
Source§fn clone(&self) -> BuildingLink
fn clone(&self) -> BuildingLink
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BuildingLink
impl Debug for BuildingLink
Source§impl Decodeable for BuildingLink
impl Decodeable for BuildingLink
Source§impl Default for BuildingLink
impl Default for BuildingLink
Source§fn default() -> BuildingLink
fn default() -> BuildingLink
Source§impl<'de> Deserialize<'de> for BuildingLink
impl<'de> Deserialize<'de> for BuildingLink
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Encodeable for BuildingLink
impl Encodeable for BuildingLink
Source§fn encode<W: WriteBytes>(
&mut self,
buffer: &mut W,
extra_data: &Option<EncodeableExtraData<'_>>,
) -> Result<()>
fn encode<W: WriteBytes>( &mut self, buffer: &mut W, extra_data: &Option<EncodeableExtraData<'_>>, ) -> Result<()>
Source§impl PartialEq for BuildingLink
impl PartialEq for BuildingLink
Source§impl Serialize for BuildingLink
impl Serialize for BuildingLink
impl StructuralPartialEq for BuildingLink
Auto Trait Implementations§
impl Freeze for BuildingLink
impl RefUnwindSafe for BuildingLink
impl Send for BuildingLink
impl Sync for BuildingLink
impl Unpin for BuildingLink
impl UnsafeUnpin for BuildingLink
impl UnwindSafe for BuildingLink
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.