Skip to content

feat(bots): implement bot decision API with 3 difficulty levels

AGUECH OMAR requested to merge feature/backend-game-logic into develop

📌 Description

  • BA6: Add /api/bot/action endpoint in bot.routes.ts

    • Easy: random (30% fold, 40% call/check, 30% raise)
    • Medium: hand strength based (preflop pairs/high cards, postflop with Evaluator)
    • Hard: probability based (pot odds, win probability, bluffs)
    • Uses getHandValue from Evaluator.ts for hand strength calculation
  • BA7: Already integrated in index.ts

  • BA8: Add frontend integration documentation in Docs/bot-integration-frontend.md

    • Complete API documentation
    • Example handleBotTurn implementation
    • Types for bot players
  • All tests passing (37/37)

  • Lint OK

🔗 Lien vers l'issue

Type de changement

  • Feature (nouvelle fonctionnalité)
  • Fix (correction de bug)
  • Refactor (pas de changement fonctionnel)
  • Docs (documentation)
  • Chore (maintenance technique)
  • Hotfix (urgence)

🧪 Comment tester

Checklist

  • Tests unitaires ajoutés/mis à jour
  • Documentation mise à jour
  • Pipeline CI vert
  • Relu par un reviewer

👥 Reviewers requis

  • Backend (@azra, @soheil)
  • Frontend (@mohamed, @yigit)
  • Sécurité (@linda, @massi)
  • BDD (@elhadj)

🚨 Impact potentiel

  • Breaking change
  • Performance
  • Sécurité

Merge request reports