Blueprints Poker 2 - Bob wins with Ace high Hearts Flush
It's possible to build an array of 52 shuffled cards on the fly, but I couldn't get it to be faster than 2 seconds. So instead I start from a pre-made static Deck that contains the required 52 cards (struct array of 4 suits and 13 names) and UE4 has a Shuffle array command which is instant.
The top part is the five dealer cards that go on the table (selection from deck only).
You could just pull by index 0,1,2,3,4 from the shuffled Deck array.
The bottom part is the selection of hole cards for the currently active players, and it discounts players sitting out. It gets the LastIndex card minus the player index for Hole Card1 then it gets the LastIndex card minus the player index minus the total number of players for Hole Card2.
Assuming Brian and Bob both saw the flop this would have been a very bad hand for Brian.
Next I have to teach UE4 to calculate the winning hand from any set of hands.
For instance, in this hand:
Brenda flops two pair and Ben has three of a kind queen. But Boss Hog stumbles onto a Diamonds Flush on the turn after playing fairly weak hole cards. Even Boss Hog would be gambling against the chance someone else might hold a nut flush, which would make this hand a nasty experience.