Skip to content

Commit 2b0c909

Browse files
committed
Added missing docs to face card bool functions
1 parent 3d267e2 commit 2b0c909

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/core/card.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ impl Value {
120120
Self::Ace => 41,
121121
}
122122
}
123+
124+
/// Returns true if the card value is of a face card (Jack, Queen, King)
125+
pub fn is_face_card(&self) -> bool {
126+
matches!(self, Self::Jack | Self::Queen | Self::King)
127+
}
123128
}
124129

125130
impl TryFrom<i32> for Value {
@@ -298,6 +303,11 @@ impl Card {
298303

299304
bit_pattern
300305
}
306+
307+
/// Returns true if the card is a face card (Jack, Queen, King)
308+
pub fn is_face_card(&self) -> bool {
309+
self.value.is_face_card()
310+
}
301311
}
302312

303313
impl From<i32> for Card {

0 commit comments

Comments
 (0)