pub struct ContainerRelative { /* private fields */ }Expand description
A container block positioned relative to another block.
Similar to ContainerAbsolute but positioned at an offset from a reference block,
allowing formations to be built up from interconnected positioned blocks.
Implementations§
Source§impl ContainerRelative
impl ContainerRelative
Sourcepub fn block_priority(&self) -> &f32
pub fn block_priority(&self) -> &f32
Priority for filling this block (higher priority blocks are filled first).
Sourcepub fn relative_block_id(&self) -> &u32
pub fn relative_block_id(&self) -> &u32
ID of the block this is positioned relative to.
Sourcepub fn entity_arrangement(&self) -> &EntityArrangement
pub fn entity_arrangement(&self) -> &EntityArrangement
How units should be arranged (line, column, crescent, etc.).
Sourcepub fn inter_entity_spacing(&self) -> &f32
pub fn inter_entity_spacing(&self) -> &f32
Spacing between units in this block.
Sourcepub fn crescent_y_offset(&self) -> &f32
pub fn crescent_y_offset(&self) -> &f32
Y-axis offset for crescent formations.
Sourcepub fn position_x(&self) -> &f32
pub fn position_x(&self) -> &f32
X offset relative to the reference block.
Sourcepub fn position_y(&self) -> &f32
pub fn position_y(&self) -> &f32
Y offset relative to the reference block.
Sourcepub fn minimum_entity_threshold(&self) -> &i32
pub fn minimum_entity_threshold(&self) -> &i32
Minimum number of units required to use this block.
Sourcepub fn maximum_entity_threshold(&self) -> &i32
pub fn maximum_entity_threshold(&self) -> &i32
Maximum number of units that can be placed in this block.
Sourcepub fn entity_preferences(&self) -> &Vec<EntityPreference>
pub fn entity_preferences(&self) -> &Vec<EntityPreference>
Ordered list of preferred unit types for this block.
Source§impl ContainerRelative
impl ContainerRelative
Sourcepub fn block_priority_mut(&mut self) -> &mut f32
pub fn block_priority_mut(&mut self) -> &mut f32
Priority for filling this block (higher priority blocks are filled first).
Sourcepub fn relative_block_id_mut(&mut self) -> &mut u32
pub fn relative_block_id_mut(&mut self) -> &mut u32
ID of the block this is positioned relative to.
Sourcepub fn entity_arrangement_mut(&mut self) -> &mut EntityArrangement
pub fn entity_arrangement_mut(&mut self) -> &mut EntityArrangement
How units should be arranged (line, column, crescent, etc.).
Sourcepub fn inter_entity_spacing_mut(&mut self) -> &mut f32
pub fn inter_entity_spacing_mut(&mut self) -> &mut f32
Spacing between units in this block.
Sourcepub fn crescent_y_offset_mut(&mut self) -> &mut f32
pub fn crescent_y_offset_mut(&mut self) -> &mut f32
Y-axis offset for crescent formations.
Sourcepub fn position_x_mut(&mut self) -> &mut f32
pub fn position_x_mut(&mut self) -> &mut f32
X offset relative to the reference block.
Sourcepub fn position_y_mut(&mut self) -> &mut f32
pub fn position_y_mut(&mut self) -> &mut f32
Y offset relative to the reference block.
Sourcepub fn minimum_entity_threshold_mut(&mut self) -> &mut i32
pub fn minimum_entity_threshold_mut(&mut self) -> &mut i32
Minimum number of units required to use this block.
Sourcepub fn maximum_entity_threshold_mut(&mut self) -> &mut i32
pub fn maximum_entity_threshold_mut(&mut self) -> &mut i32
Maximum number of units that can be placed in this block.
Sourcepub fn entity_preferences_mut(&mut self) -> &mut Vec<EntityPreference>
pub fn entity_preferences_mut(&mut self) -> &mut Vec<EntityPreference>
Ordered list of preferred unit types for this block.
Source§impl ContainerRelative
impl ContainerRelative
Sourcepub fn set_block_priority(&mut self, val: f32) -> &mut Self
pub fn set_block_priority(&mut self, val: f32) -> &mut Self
Priority for filling this block (higher priority blocks are filled first).
Sourcepub fn set_relative_block_id(&mut self, val: u32) -> &mut Self
pub fn set_relative_block_id(&mut self, val: u32) -> &mut Self
ID of the block this is positioned relative to.
Sourcepub fn set_entity_arrangement(&mut self, val: EntityArrangement) -> &mut Self
pub fn set_entity_arrangement(&mut self, val: EntityArrangement) -> &mut Self
How units should be arranged (line, column, crescent, etc.).
Sourcepub fn set_inter_entity_spacing(&mut self, val: f32) -> &mut Self
pub fn set_inter_entity_spacing(&mut self, val: f32) -> &mut Self
Spacing between units in this block.
Sourcepub fn set_crescent_y_offset(&mut self, val: f32) -> &mut Self
pub fn set_crescent_y_offset(&mut self, val: f32) -> &mut Self
Y-axis offset for crescent formations.
Sourcepub fn set_position_x(&mut self, val: f32) -> &mut Self
pub fn set_position_x(&mut self, val: f32) -> &mut Self
X offset relative to the reference block.
Sourcepub fn set_position_y(&mut self, val: f32) -> &mut Self
pub fn set_position_y(&mut self, val: f32) -> &mut Self
Y offset relative to the reference block.
Sourcepub fn set_minimum_entity_threshold(&mut self, val: i32) -> &mut Self
pub fn set_minimum_entity_threshold(&mut self, val: i32) -> &mut Self
Minimum number of units required to use this block.
Sourcepub fn set_maximum_entity_threshold(&mut self, val: i32) -> &mut Self
pub fn set_maximum_entity_threshold(&mut self, val: i32) -> &mut Self
Maximum number of units that can be placed in this block.
Sourcepub fn set_entity_preferences(
&mut self,
val: Vec<EntityPreference>,
) -> &mut Self
pub fn set_entity_preferences( &mut self, val: Vec<EntityPreference>, ) -> &mut Self
Ordered list of preferred unit types for this block.
Trait Implementations§
Source§impl Clone for ContainerRelative
impl Clone for ContainerRelative
Source§fn clone(&self) -> ContainerRelative
fn clone(&self) -> ContainerRelative
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContainerRelative
impl Debug for ContainerRelative
Source§impl Default for ContainerRelative
impl Default for ContainerRelative
Source§fn default() -> ContainerRelative
fn default() -> ContainerRelative
Source§impl<'de> Deserialize<'de> for ContainerRelative
impl<'de> Deserialize<'de> for ContainerRelative
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 PartialEq for ContainerRelative
impl PartialEq for ContainerRelative
Source§impl Serialize for ContainerRelative
impl Serialize for ContainerRelative
impl StructuralPartialEq for ContainerRelative
Auto Trait Implementations§
impl Freeze for ContainerRelative
impl RefUnwindSafe for ContainerRelative
impl Send for ContainerRelative
impl Sync for ContainerRelative
impl Unpin for ContainerRelative
impl UnsafeUnpin for ContainerRelative
impl UnwindSafe for ContainerRelative
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.