@block52/poker-vm-sdk 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +14 -2
- package/dist/index.esm.js +43 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +43 -8
- package/dist/index.js.map +1 -1
- package/dist/pokerSolver.d.ts +15 -3
- package/dist/pokerSolver.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/pokerSolver.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Card } from "./types/game";
|
|
1
|
+
import { Card, GameVariant } from "./types/game";
|
|
2
2
|
/**
|
|
3
3
|
* Poker hand types in order of strength (weakest to strongest)
|
|
4
4
|
*/
|
|
@@ -52,6 +52,16 @@ export declare class PokerSolver {
|
|
|
52
52
|
* Find the best 5-card hand from 7 cards
|
|
53
53
|
*/
|
|
54
54
|
static findBestHand(cards: Card[]): HandEvaluation;
|
|
55
|
+
/**
|
|
56
|
+
* Find the best Omaha hand: EXACTLY 2 of the 4 hole cards and EXACTLY 3 of
|
|
57
|
+
* the 5 board cards — C(4,2) x C(5,3) = 60 candidates, ranked like Hold'em.
|
|
58
|
+
* Mirrors the engine's FindBestOmahaHand (poker-vm#2650).
|
|
59
|
+
*/
|
|
60
|
+
static findBestOmahaHand(holeCards: Card[], communityCards: Card[]): HandEvaluation;
|
|
61
|
+
/**
|
|
62
|
+
* Best hand for a variant from hole cards and a full 5-card board.
|
|
63
|
+
*/
|
|
64
|
+
private static bestHandForVariant;
|
|
55
65
|
/**
|
|
56
66
|
* Evaluate a hand with any number of cards (2-7)
|
|
57
67
|
* This is useful for showing hand strength during all betting rounds
|
|
@@ -133,12 +143,14 @@ export declare class PokerSolver {
|
|
|
133
143
|
static calculateWinPercentages(handA: Card[], handB: Card[], communityCards?: Card[], simulations?: number): [number, number, number];
|
|
134
144
|
/**
|
|
135
145
|
* Calculate win percentages for multiple players (2+) using Monte Carlo simulation
|
|
136
|
-
* @param hands Array of hole cards for each player (each
|
|
146
|
+
* @param hands Array of hole cards for each player (2 each for Hold'em, 4 for Omaha)
|
|
137
147
|
* @param communityCards Current community cards (0-5 cards)
|
|
138
148
|
* @param simulations Number of simulations to run (default: 10000)
|
|
149
|
+
* @param variant The table's variant; omitted = Texas Hold'em. Omaha hands are
|
|
150
|
+
* scored with the two-plus-three rule (ui#769).
|
|
139
151
|
* @returns Object containing win percentages for each player and overall tie percentage
|
|
140
152
|
*/
|
|
141
|
-
static calculateMultiPlayerEquity(hands: Card[][], communityCards?: Card[], simulations?: number): {
|
|
153
|
+
static calculateMultiPlayerEquity(hands: Card[][], communityCards?: Card[], simulations?: number, variant?: GameVariant): {
|
|
142
154
|
winPercentages: number[];
|
|
143
155
|
tiePercentage: number;
|
|
144
156
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pokerSolver.d.ts","sourceRoot":"","sources":["../src/pokerSolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAQ,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"pokerSolver.d.ts","sourceRoot":"","sources":["../src/pokerSolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAQ,MAAM,cAAc,CAAC;AAGvD;;GAEG;AACH,oBAAY,QAAQ;IAChB,SAAS,IAAI;IACb,IAAI,IAAI;IACR,QAAQ,IAAI;IACZ,eAAe,IAAI;IACnB,QAAQ,IAAI;IACZ,KAAK,IAAI;IACT,UAAU,IAAI;IACd,cAAc,IAAI;IAClB,cAAc,IAAI;IAClB,WAAW,IAAI;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,qB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