#[repr(u8)]pub enum Category {
Show 13 variants
Aces = 0,
Twos = 1,
Threes = 2,
Fours = 3,
Fives = 4,
Sixes = 5,
ThreeOfAKind = 6,
FourOfAKind = 7,
FullHouse = 8,
SmallStraight = 9,
LargeStraight = 10,
Yahtzee = 11,
Chance = 12,
}Expand description
A scoring category on the card.
The discriminant is the category’s bit position in Categories,
upper section first, so Aces..=Sixes are bits 0..=5.
Variants§
Aces = 0
Total of dice showing 1.
Twos = 1
Total of dice showing 2.
Threes = 2
Total of dice showing 3.
Fours = 3
Total of dice showing 4.
Fives = 4
Total of dice showing 5.
Sixes = 5
Total of dice showing 6.
ThreeOfAKind = 6
Total of all dice, if at least three show the same face.
FourOfAKind = 7
Total of all dice, if at least four show the same face.
FullHouse = 8
25 points for three of one face and two of another.
SmallStraight = 9
30 points for four faces in sequence.
LargeStraight = 10
40 points for five faces in sequence.
Yahtzee = 11
50 points for five of a kind.
Chance = 12
Total of all dice, no requirement.
Implementations§
Source§impl Category
impl Category
Sourcepub const fn upper_face(self) -> Option<u8>
pub const fn upper_face(self) -> Option<u8>
The face this upper-section category counts, or None for the
lower section.
Sourcepub const fn upper(face: u8) -> Option<Self>
pub const fn upper(face: u8) -> Option<Self>
The upper-section category counting face (1..=6).
Returns None for faces outside 1..=6.
Sourcepub const fn bit(self) -> Categories
pub const fn bit(self) -> Categories
This category as a one-element set.
Trait Implementations§
impl Copy for Category
impl Eq for Category
Source§impl From<Category> for Categories
impl From<Category> for Categories
Source§impl Ord for Category
impl Ord for Category
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Category
impl PartialOrd for Category
impl StructuralPartialEq for Category
Auto Trait Implementations§
impl Freeze for Category
impl RefUnwindSafe for Category
impl Send for Category
impl Sync for Category
impl Unpin for Category
impl UnsafeUnpin for Category
impl UnwindSafe for Category
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