- HSP_GAME_START
- HSP_GAME_PAUSE
- HSP_GAME_RESUME
- HSP_GAME_STOP
- HSP_NEW_GAME
- HSP_DONE_PREPARATION
- HSP_NEW_ROUND
- HSP_NEW_CARD
- HSP_DISTRIBUTED_CARD
- HSP_GOT_CARD
- HSP_BET_TURN
- HSP_PLAY_TURN
- HSP_CALLED
- HSP_RAISED
- HSP_CHECKED
- HSP_FOLD
- HSP_ALLIN
- HSP_CLOSE_ROUND
- HSP_ROUND_RESULT
- HSP_CHIP_RESULT
- HSP_DONE_CLOSE
- HSP_TIME_TICK
- HSP_TOO_IDLE
- HSP_TRANSCRIPT
- HSP_ACTION
- HSP_ADVICE_TALK
State diagram :
Poker game continues until that user presses stop button or one of player lose all money.
Game starts from new_game.

Dealer creates player information table, and registers players.
Dealers sends "new_game" to the players.

Each player initializes its status and creates guessing table for archiving opponent's status in future.
Player sends "don_preparation" to all objects with player number, money, hand eval value.

If Dealer updates all player information into table(dealer has number of players info, so dealer waits till receiving "done_preparation" from all players), it sends "new_round" to itself.


First two cards to each players don't update to player table.
Dealer sends "new_card" to dealer and each player.






The turn queue is empty and street number is less than 7th street, go back to "new_card" state.
The turn queue is empty and show down flag is active, then it sends "close_round" to itself.
The turn queue is empty and street number is 7th street, then it sends "close_round" to itself.





It sends "done_close" with players chips amount to dealer.

If dealer gets "done_close" from all player, then check all player's chips.
If one of players have 0 chips, then it sends "game_over" to all.
Otherwise, it sends "new_round" to itself.
No comments:
Post a Comment