Well, That’s a good question. Roughly speaking, everytime a player goes all-in a Side Pot
Is created. After the creation of a Side Pot
other players can still play, first by matching the all-in player’s bets (hence, joining the Side Pot
) and then by betting above the all-in player capacity (hence joining the Playing Pot
)
If you enter the betting round with all-in then you are never part of the Playing Pot
but you are part of the Side Pot
(the one created by your all-in)
No, actually. a Side Pot
always include the “last bet” (unless they win) of someone. Instead of a list of Side Pot
you could use a Map Player (Side Pot)
, but thats an implementation detail irrelevant for the thing in disccussion which are Type indexes hahaha
Don’t know exactly what you mean, but I think no
No. For every pot you look who is participating, and the one with the highest hand, wins that pot. Notice a hand can have multiple winner, one for each pot (either playing pot, or side pot). The order, desn’t matter at all
Usually yes, but it isn’t necessary. In general:
- a Player can be in many pots (playing or side)
- Given two pots (playing or side), the set of players in it must be not equal (That is hard to represent at type level I think)
- there is no relation “Players in Side must be in Playing”, but It is true the other way: “Players in Playing must be in all Side pots”
Given the last condition the representation PlayingPot = Map Player (Amount, Set SidePotId)
looks promising, but there is a catch. Players in all-in situation do not participate in the playing pot, so they should be filter out when deciding who wins that pot. You could always represent all-in players as players with a zero amount… but that’s quite artificial. This representation has the advantage that you can decide who wins a pot by simply comparing the hands of the participant of the pot… of course, other representations could be possible