pub struct Weights<const N: usize>(pub [i32; N]);Expand description
What a kind of player cares about each of a game’s N features, in
the order of the game’s names.
Tuple Fields§
§0: [i32; N]Implementations§
Source§impl<const N: usize> Weights<N>
impl<const N: usize> Weights<N>
Sourcepub fn from_named(
names: &[&str; N],
by_name: &BTreeMap<String, i32>,
) -> Result<Self, UnknownFeature>
pub fn from_named( names: &[&str; N], by_name: &BTreeMap<String, i32>, ) -> Result<Self, UnknownFeature>
The weights of by_name, put in the order of names. A feature
by_name leaves out weighs 0.
§Errors
UnknownFeature for the first name of by_name (in its order)
that isn’t one of names.
Trait Implementations§
impl<const N: usize> Copy for Weights<N>
impl<const N: usize> Eq for Weights<N>
impl<const N: usize> StructuralPartialEq for Weights<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for Weights<N>
impl<const N: usize> RefUnwindSafe for Weights<N>
impl<const N: usize> Send for Weights<N>
impl<const N: usize> Sync for Weights<N>
impl<const N: usize> Unpin for Weights<N>
impl<const N: usize> UnsafeUnpin for Weights<N>
impl<const N: usize> UnwindSafe for Weights<N>
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