pub struct Hand { /* fields omitted */ }
Expand description
Manages the number of each pieces in each player’s hand.
use shuuro::{Color, Hand, Piece, PieceType};
let mut hand: Hand = Default::default();
let blue_pawn = Piece{piece_type: PieceType::Pawn, color: Color::Blue};
let red_pawn = Piece{piece_type: PieceType::Pawn, color: Color::Red};
hand.set(blue_pawn, 2);
hand.increment(blue_pawn);
assert_eq!(3, hand.get(blue_pawn));
assert_eq!(0, hand.get(red_pawn));
Returns a number of the given piece.
Sets a number of the given piece.
Increments a number of the given piece.
Decrements a number of the given piece.
Set hand with all pieces from str.
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,