pub struct WfcRuleSet { /* private fields */ }Expand description
Tile weights and four-way adjacency compatibility rules for WfcSolver2D.
Implementations§
Source§impl WfcRuleSet
Rule-set construction and symmetric adjacency registration for WfcRuleSet.
impl WfcRuleSet
Rule-set construction and symmetric adjacency registration for WfcRuleSet.
Sourcepub fn set_weight(&mut self, tile_index: usize, weight: f32)
pub fn set_weight(&mut self, tile_index: usize, weight: f32)
Sets the relative selection weight for tile_index (clamped to >= 1e-4).
§Arguments
usize- Tile index.f32- Positive tile weight.
Sourcepub fn allow_adjacency(
&mut self,
tile_a: usize,
dir: WfcDirection,
tile_b: usize,
)
pub fn allow_adjacency( &mut self, tile_a: usize, dir: WfcDirection, tile_b: usize, )
Allows tile_b to sit directly in direction dir from tile_a (and registers the symmetric opposite).
§Arguments
usize- Source tile index.WfcDirection- Cardinal direction fromtile_atotile_b.usize- Neighbor tile index.
Sourcepub fn allow_all_directions(&mut self, tile_a: usize, tile_b: usize)
pub fn allow_all_directions(&mut self, tile_a: usize, tile_b: usize)
Allows tile_a and tile_b to sit adjacent in all four cardinal directions.
§Arguments
usize- First tile index.usize- Second tile index.
Sourcepub fn is_compatible(
&self,
tile_a: usize,
dir: WfcDirection,
tile_b: usize,
) -> bool
pub fn is_compatible( &self, tile_a: usize, dir: WfcDirection, tile_b: usize, ) -> bool
Source§impl WfcRuleSet
Implements impl #impl_generics #name #ty_generics #where_clause.
impl WfcRuleSet
Implements impl #impl_generics #name #ty_generics #where_clause.
pub fn get_tile_count(&self) -> usize
pub fn get_mut_tile_count(&mut self) -> &mut usize
pub fn set_tile_count(&mut self, val: usize) -> &mut Self
pub fn get_weights(&self) -> &Vec<f32>
pub fn get_mut_weights(&mut self) -> &mut Vec<f32>
pub fn set_weights(&mut self, val: Vec<f32>) -> &mut Self
Trait Implementations§
Source§impl Clone for WfcRuleSet
impl Clone for WfcRuleSet
Auto Trait Implementations§
impl Forget for WfcRuleSet
impl Freeze for WfcRuleSet
impl Move for WfcRuleSet
impl RefUnwindSafe for WfcRuleSet
impl Send for WfcRuleSetwhere
RawVecInner: Send,
impl Sync for WfcRuleSetwhere
RawVecInner: Sync,
impl Unpin for WfcRuleSet
impl UnsafeUnpin for WfcRuleSetwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<f32>: UnsafeUnpin,
PhantomData<[WfcMask; 4]>: UnsafeUnpin,
impl UnwindSafe for WfcRuleSetwhere
RawVecInner: UnwindSafe,
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
Mutably borrows from an owned value. Read more