Struct shuuro::hand::Hand [−][src]
pub struct Hand { /* fields omitted */ }
Expand description
Manages the number of each pieces in each player’s hand.
Examples
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));