pub fn new(game_config: &game_config::GameConfig<'_>) -> Self {
        let board_layout = game_config.board_layout();
        let dim = board_layout.dim();
        let rack_size = game_config.rack_size() as usize;
        let alphabet = game_config.alphabet();
        Self {
            players: (0..game_config.num_players())
                .map(|_| GamePlayer {
                    score: 0,
                    rack: Vec::with_capacity(rack_size),
                })
                .collect(),
            board_tiles: vec![0u8; (dim.rows as usize) * (dim.cols as usize)].into_boxed_slice(),
            bag: bag::Bag::new(alphabet),
            turn: 0,
            zero_turns: 0,
        }
    }
// The other methods must be called with the same game_config.
The other methods must be called with the same game_config.
The other methods must be called with the same game_config .
pub fn new(game_config: &game_config::GameConfig<'_>) -> Self {
        let board_layout = game_config.board_layout();
        let dim = board_layout.dim();
        let rack_size = game_config.rack_size() as usize;
        let alphabet = game_config.alphabet();
        Self {
            players: (0..game_config.num_players())
                .map(|_| GamePlayer {
                    score: 0,
                    rack: Vec::with_capacity(rack_size),
                })
                .collect(),
            board_tiles: vec![0u8; (dim.rows as usize) * (dim.cols as usize)].into_boxed_slice(),
            bag: bag::Bag::new(alphabet),
            turn: 0,
            zero_turns: 0,
        }
    }
pub fn new ( game_config : & game_config :: GameConfig < ' _ > ) -> Self { let board_layout = game_config . board_layout ( ) ; let dim = board_layout . dim ( ) ; let rack_size = game_config . rack_size ( ) as usize ; let alphabet = game_config . alphabet ( ) ; Self { players : ( 0 .. game_config . num_players ( ) ) . map ( | _ | GamePlayer { score : 0 , rack : Vec :: with_capacity ( rack_size ) , } ) . collect ( ) , board_tiles : vec ! [ 0u8 ( dim rows as usize ) ( dim cols as usize ) ] . into_boxed_slice ( ) , bag : bag :: Bag :: new ( alphabet ) , turn : 0 , zero_turns : 0 , } }
The other methods must be called with the same game_config.
The other methods must be called with the same game_config .
game_config
&game_config::GameConfig<'_>
game_config
&game_config::GameConfig<'_>