fn do_game<S>(
    // game_type: GameType,
    // small_blind: Money,
    // big_blind: Money,
    // stack: Money,
    table_request: TableRequest,
    mut clients: Vec<Client<S>>,
    tx3: Sender<(TableRequest, Client<S>)>,
) where
    S: Stream + Send + 'static,
{
    Table::new(
        table_request.game_type,
        table_request.small_blind,
        table_request.big_blind,
        vec![table_request.stack; clients.len()],
        Adapter {
            clients: &mut clients,
        },
    )
    .play();
    // one of the players got kicked for erroring, return other players
    while let Some(client) = clients.pop() {
        tx3.send((table_request, client)).ok();
    }
}
/// Single-game-type logic. Create a table and keep playing until one of the
/// players generates an error. Kick that player and return the other players
/// to the queue.
Single-game-type logic. Create a table and keep playing until one of the
players generates an error. Kick that player and return the other players
to the queue.
Single - game - type logic . Create a table and keep playing until one of the players generates an error . Kick that player and return the other players to the queue .
fn do_game<S>(
    // game_type: GameType,
    // small_blind: Money,
    // big_blind: Money,
    // stack: Money,
    table_request: TableRequest,
    mut clients: Vec<Client<S>>,
    tx3: Sender<(TableRequest, Client<S>)>,
) where
    S: Stream + Send + 'static,
{
    Table::new(
        table_request.game_type,
        table_request.small_blind,
        table_request.big_blind,
        vec![table_request.stack; clients.len()],
        Adapter {
            clients: &mut clients,
        },
    )
    .play();
    // one of the players got kicked for erroring, return other players
    while let Some(client) = clients.pop() {
        tx3.send((table_request, client)).ok();
    }
}
fn do_game < S > ( // game_type: GameType, // small_blind: Money, // big_blind: Money, // stack: Money, table_request : TableRequest , mut clients : Vec < Client < S > > , tx3 : Sender < ( TableRequest , Client < S > ) > , ) where S : Stream + Send + ' static , { Table :: new ( table_request . game_type , table_request . small_blind , table_request . big_blind , vec ! [ table_request stack clients len ( ) ] , Adapter { clients : & mut clients , } , ) . play ( ) ; // one of the players got kicked for erroring, return other players while let Some ( client ) = clients . pop ( ) { tx3 . send ( ( table_request , client ) ) . ok ( ) ; } }
Single-game-type logic.
Single - game - type logic .
table_request
TableRequest
clients
Vec<Client<S>>
tx3
Sender<(TableRequest, Client<S>)>
table_request
TableRequest
clients
Vec<Client<S>>
tx3
Sender<(TableRequest, Client<S>)>