seatView
seatView<
T,H>(perSeat,viewer,hidden): (T|H)[]
Defined in: cards/visibility.ts:43
Shows a viewer the values for the seats they hold and a hidden form of every other
seat's value. perSeat is indexed by seat; viewer is the Viewer passed to view()
(spectators hold no seats, so they see only hidden forms).
view: ({ state, viewer }) => ({ ...state, hands: seatView(state.hands, viewer, faceDown), // own hand, others as nulls bets: state.bets, // public, left as is deck: state.deck.length, // never send the deck itself}),hidden also receives the seat, for example to reveal hands at showdown:
seatView(state.hands, viewer, (hand, seat) => revealTo(hand, state.shown[seat])).
Type Parameters
Section titled “Type Parameters”T
H
Parameters
Section titled “Parameters”perSeat
Section titled “perSeat”readonly T[]
viewer
Section titled “viewer”readonly number[]
hidden
Section titled “hidden”(value, seat) => H
Returns
Section titled “Returns”(T | H)[]
