@idealic/poker-engine
Version:
Professional poker game engine and hand evaluator with built-in iterator utilities
51 lines • 1.86 kB
TypeScript
/**
* Game analytics extension demonstrating module augmentation pattern.
* This file shows how to extend the Game namespace with additional functionality.
*/
import type { Game } from '../Game';
/**
* Calculate the approximate win probability for a player based on game state.
* This is a simplified implementation for demonstration purposes.
*
* @param game - Current game state
* @param playerId - Name of the player to calculate win probability for
* @returns Win probability as a decimal between 0 and 1
*/
export declare function getWinProbability(game: Game, playerId: string): number;
/**
* Calculate the current pot odds for the next player to act.
*
* @param game - Current game state
* @returns Pot odds as a decimal (amount to call / total pot after call)
*/
export declare function getPotOdds(game: Game): number;
/**
* Calculate expected value for a call based on win probability and pot odds.
*
* @param game - Current game state
* @param playerId - Name of the player considering the call
* @returns Expected value as a positive or negative number
*/
export declare function getCallExpectedValue(game: Game, playerId: string): number;
/**
* Get game phase analysis including aggression factors and betting patterns.
*
* @param game - Current game state
* @returns Analysis object with various game metrics
*/
export declare function getGameAnalysis(game: Game): {
phase: string;
aggressionFactor: number;
averageStack: number;
potToStackRatio: number;
activePlayers: number;
};
declare module '../Game' {
namespace Game {
const getWinProbability: typeof getWinProbability;
const getPotOdds: typeof getPotOdds;
const getCallExpectedValue: typeof getCallExpectedValue;
const getGameAnalysis: typeof getGameAnalysis;
}
}
//# sourceMappingURL=analytics.d.ts.map