doper1 / POK

A whatsapp bot for playing poker
0 stars 0 forks source link

FEATURE: add support for rebuys, and update the amount of game at the end of the game #70

Closed doper1 closed 1 day ago

doper1 commented 2 weeks ago

Currently there is no continuity between session. for each player there a global money amount (money) and money amount for the game (game_money). We need to add support for using the total money account and updating it by game results

Requirements:

The whole design should be minimal and with thinking about DB integration

doper1 commented 4 days ago

Wrote rebuy function, currently writing tests

doper1 commented 4 days ago

One test remained to fix then go to the next task

doper1 commented 3 days ago

Add rebuy function in inGame route V Add to exit functionalty of adding the game money into money V Add validation for joining with 0 money V (Should be impl with DB) Add feature to put players with 0 game money as folded until they rebuy V Add rebuy to the inGame help menu V Add check in init round for if a SB or BB are folded (has no money) skip them. if only one player got money- Return a winner message, summery message and end the game

doper1 commented 2 days ago

All is remains is to finish writing endGame and validating the code with unit tests. then commit and merge: feat: add rebuy functionality. solves #70

doper1 commented 2 days ago

endGame function is written. remains:

  1. Fix typo in constants V
  2. Check linting errors V
  3. Understand why start is failing after trying it in the second round
  4. add a flag for starting again after the first session is done so it won't take more money from players that are already in
  5. Change the name of pre-game re-buy to buy--------------------------------
  6. format the winning message with outer minus and possible emojies consider model of removing automatic money taking, or taking money on join instead of start, or allowing pok join 100 and if not specified default to 100
doper1 commented 1 day ago
  1. Link 'pok end' to Game.endGame() V
  2. Decide on money architecture for entering round and between roundsV
  3. implement the architecture in start, initRound, endGame and buy (can be based on the model of poker now and on domestic games. when session is ended players are still at the table with their amounts to make new round easier (or just disband them)V
  4. Add formatting to end game winning message with possibly emojiesV
doper1 commented 1 day ago

Done. When DB is integrated players will be deleted from the game upon exit but not from the DB. This because we need to keep track of their money (Player.money)