pub struct BmdVegetation { /* private fields */ }Expand description
Represents a BMD Vegetation file decoded in memory.
This struct contains all vegetation placement data for a battle map, including individual tree instances and grass coverage areas. Vegetation data is stored separately from the main BMD file to allow independent editing.
§Fields
serialise_version: File format version (currently only version 2)tree_list: List of individual tree placementsgrass_list: List of grass coverage areas
§Version Support
- Version 2: Current format used in Warhammer III
§Integration
Vegetation files work in conjunction with BMD files. The BMD file contains
references to vegetation data via TreeListReferenceList and GrassListReferenceList,
while this file contains the actual placement data.
§Example
use rpfm_lib::files::bmd_vegetation::BmdVegetation;
use rpfm_lib::files::Decodeable;
let vegetation = BmdVegetation::decode(&mut reader, &None)?;
// Access tree data
for tree in vegetation.tree_list().list() {
println!("Tree at ({}, {}, {})",
tree.position().x(),
tree.position().y(),
tree.position().z()
);
}
// Access grass data
for grass in vegetation.grass_list().list() {
println!("Grass patch: {}", grass.grass_type());
}Implementations§
Source§impl BmdVegetation
impl BmdVegetation
Sourcepub fn serialise_version(&self) -> &u16
pub fn serialise_version(&self) -> &u16
File format version number (currently only version 2).
Sourcepub fn grass_list(&self) -> &GrassList
pub fn grass_list(&self) -> &GrassList
List of grass coverage areas.
Source§impl BmdVegetation
impl BmdVegetation
Sourcepub fn serialise_version_mut(&mut self) -> &mut u16
pub fn serialise_version_mut(&mut self) -> &mut u16
File format version number (currently only version 2).
Sourcepub fn tree_list_mut(&mut self) -> &mut TreeList
pub fn tree_list_mut(&mut self) -> &mut TreeList
List of individual tree placements.
Sourcepub fn grass_list_mut(&mut self) -> &mut GrassList
pub fn grass_list_mut(&mut self) -> &mut GrassList
List of grass coverage areas.
Source§impl BmdVegetation
impl BmdVegetation
Sourcepub fn set_serialise_version(&mut self, val: u16) -> &mut Self
pub fn set_serialise_version(&mut self, val: u16) -> &mut Self
File format version number (currently only version 2).
Sourcepub fn set_tree_list(&mut self, val: TreeList) -> &mut Self
pub fn set_tree_list(&mut self, val: TreeList) -> &mut Self
List of individual tree placements.
Sourcepub fn set_grass_list(&mut self, val: GrassList) -> &mut Self
pub fn set_grass_list(&mut self, val: GrassList) -> &mut Self
List of grass coverage areas.
Trait Implementations§
Source§impl Clone for BmdVegetation
impl Clone for BmdVegetation
Source§fn clone(&self) -> BmdVegetation
fn clone(&self) -> BmdVegetation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BmdVegetation
impl Debug for BmdVegetation
Source§impl Decodeable for BmdVegetation
impl Decodeable for BmdVegetation
Source§impl Default for BmdVegetation
impl Default for BmdVegetation
Source§fn default() -> BmdVegetation
fn default() -> BmdVegetation
Source§impl<'de> Deserialize<'de> for BmdVegetation
impl<'de> Deserialize<'de> for BmdVegetation
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 BmdVegetation
impl Encodeable for BmdVegetation
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 BmdVegetation
impl PartialEq for BmdVegetation
Source§impl Serialize for BmdVegetation
impl Serialize for BmdVegetation
Source§impl ToLayer for BmdVegetation
impl ToLayer for BmdVegetation
impl StructuralPartialEq for BmdVegetation
Auto Trait Implementations§
impl Freeze for BmdVegetation
impl RefUnwindSafe for BmdVegetation
impl Send for BmdVegetation
impl Sync for BmdVegetation
impl Unpin for BmdVegetation
impl UnsafeUnpin for BmdVegetation
impl UnwindSafe for BmdVegetation
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.