pub struct Flags { /* private fields */ }Expand description
Boolean flags controlling entity behavior and visibility.
This structure contains various flags that control how entities (buildings, props, etc.) behave in the game, including placement rules, seasonal visibility, and tactical view settings.
§Flag Categories
§Placement Flags
allow_in_outfield: Entity can be placed outside the playable areaclamp_to_surface: Entity position is clamped to terrain surfaceclamp_to_water_surface: Entity position is clamped to water surface
§Seasonal Flags
spring,summer,autumn,winter: Entity is visible in specified seasons
§Visibility Flags
visible_in_tactical_view: Entity is visible in tactical camera viewvisible_in_tactical_view_only: Entity is only visible in tactical view
§Example
use rpfm_lib::files::bmd::common::flags::Flags;
let mut flags = Flags::default();
flags.set_serialise_version(4);
flags.set_spring(true);
flags.set_summer(true);
flags.set_clamp_to_surface(true);
flags.set_visible_in_tactical_view(true);Implementations§
Source§impl Flags
impl Flags
Sourcepub fn serialise_version(&self) -> &u16
pub fn serialise_version(&self) -> &u16
Format version number (1-4).
Sourcepub fn allow_in_outfield(&self) -> &bool
pub fn allow_in_outfield(&self) -> &bool
Whether the entity can be placed in the outfield (outside playable area).
Sourcepub fn clamp_to_surface(&self) -> &bool
pub fn clamp_to_surface(&self) -> &bool
Whether the entity position is clamped to the terrain surface.
Sourcepub fn clamp_to_water_surface(&self) -> &bool
pub fn clamp_to_water_surface(&self) -> &bool
Whether the entity position is clamped to the water surface.
Sourcepub fn visible_in_tactical_view(&self) -> &bool
pub fn visible_in_tactical_view(&self) -> &bool
Whether the entity is visible in tactical camera view.
Sourcepub fn visible_in_tactical_view_only(&self) -> &bool
pub fn visible_in_tactical_view_only(&self) -> &bool
Whether the entity is only visible in tactical view (hidden in normal view).
Source§impl Flags
impl Flags
Sourcepub fn serialise_version_mut(&mut self) -> &mut u16
pub fn serialise_version_mut(&mut self) -> &mut u16
Format version number (1-4).
Sourcepub fn allow_in_outfield_mut(&mut self) -> &mut bool
pub fn allow_in_outfield_mut(&mut self) -> &mut bool
Whether the entity can be placed in the outfield (outside playable area).
Sourcepub fn clamp_to_surface_mut(&mut self) -> &mut bool
pub fn clamp_to_surface_mut(&mut self) -> &mut bool
Whether the entity position is clamped to the terrain surface.
Sourcepub fn clamp_to_water_surface_mut(&mut self) -> &mut bool
pub fn clamp_to_water_surface_mut(&mut self) -> &mut bool
Whether the entity position is clamped to the water surface.
Sourcepub fn spring_mut(&mut self) -> &mut bool
pub fn spring_mut(&mut self) -> &mut bool
Whether the entity is visible during spring season.
Sourcepub fn summer_mut(&mut self) -> &mut bool
pub fn summer_mut(&mut self) -> &mut bool
Whether the entity is visible during summer season.
Sourcepub fn autumn_mut(&mut self) -> &mut bool
pub fn autumn_mut(&mut self) -> &mut bool
Whether the entity is visible during autumn season.
Sourcepub fn winter_mut(&mut self) -> &mut bool
pub fn winter_mut(&mut self) -> &mut bool
Whether the entity is visible during winter season.
Sourcepub fn visible_in_tactical_view_mut(&mut self) -> &mut bool
pub fn visible_in_tactical_view_mut(&mut self) -> &mut bool
Whether the entity is visible in tactical camera view.
Sourcepub fn visible_in_tactical_view_only_mut(&mut self) -> &mut bool
pub fn visible_in_tactical_view_only_mut(&mut self) -> &mut bool
Whether the entity is only visible in tactical view (hidden in normal view).
Source§impl Flags
impl Flags
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-4).
Sourcepub fn set_allow_in_outfield(&mut self, val: bool) -> &mut Self
pub fn set_allow_in_outfield(&mut self, val: bool) -> &mut Self
Whether the entity can be placed in the outfield (outside playable area).
Sourcepub fn set_clamp_to_surface(&mut self, val: bool) -> &mut Self
pub fn set_clamp_to_surface(&mut self, val: bool) -> &mut Self
Whether the entity position is clamped to the terrain surface.
Sourcepub fn set_clamp_to_water_surface(&mut self, val: bool) -> &mut Self
pub fn set_clamp_to_water_surface(&mut self, val: bool) -> &mut Self
Whether the entity position is clamped to the water surface.
Sourcepub fn set_spring(&mut self, val: bool) -> &mut Self
pub fn set_spring(&mut self, val: bool) -> &mut Self
Whether the entity is visible during spring season.
Sourcepub fn set_summer(&mut self, val: bool) -> &mut Self
pub fn set_summer(&mut self, val: bool) -> &mut Self
Whether the entity is visible during summer season.
Sourcepub fn set_autumn(&mut self, val: bool) -> &mut Self
pub fn set_autumn(&mut self, val: bool) -> &mut Self
Whether the entity is visible during autumn season.
Sourcepub fn set_winter(&mut self, val: bool) -> &mut Self
pub fn set_winter(&mut self, val: bool) -> &mut Self
Whether the entity is visible during winter season.
Sourcepub fn set_visible_in_tactical_view(&mut self, val: bool) -> &mut Self
pub fn set_visible_in_tactical_view(&mut self, val: bool) -> &mut Self
Whether the entity is visible in tactical camera view.
Sourcepub fn set_visible_in_tactical_view_only(&mut self, val: bool) -> &mut Self
pub fn set_visible_in_tactical_view_only(&mut self, val: bool) -> &mut Self
Whether the entity is only visible in tactical view (hidden in normal view).
Trait Implementations§
Source§impl Decodeable for Flags
impl Decodeable for Flags
Source§impl<'de> Deserialize<'de> for Flags
impl<'de> Deserialize<'de> for Flags
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 Flags
impl Encodeable for Flags
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<()>
impl StructuralPartialEq for Flags
Auto Trait Implementations§
impl Freeze for Flags
impl RefUnwindSafe for Flags
impl Send for Flags
impl Sync for Flags
impl Unpin for Flags
impl UnsafeUnpin for Flags
impl UnwindSafe for Flags
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.