IPVGO: Provide API for getting game stats per opponent (#1255)

Give users access to wins, losses, stat bonuses, and favor gained
This commit is contained in:
Michael Ficocelli
2024-05-10 04:57:03 -04:00
committed by GitHub
parent 35c32e2871
commit b53c35126e
9 changed files with 100 additions and 3 deletions

View File

@@ -3949,6 +3949,17 @@ type GoOpponent =
| "Illuminati"
| "????????????";
/** @public */
type SimpleOpponentStats = {
wins: number;
losses: number;
winStreak: number;
highestWinStreak: number;
favor: number;
bonusPercent: number;
bonusDescription: string;
};
/**
* IPvGO api
* @public
@@ -4167,6 +4178,28 @@ export interface Go {
* (This is intentionally expensive; you can derive this info from just getBoardState() )
*/
getControlledEmptyNodes(): string[];
/**
* Displays the game history, captured nodes, and gained bonuses for each opponent you have played against.
*
* The details are keyed by opponent name, in this structure:
*
* <pre lang="javascript">
* {
* <OpponentName>: {
* wins: number,
* losses: number,
* winStreak: number,
* highestWinStreak: number,
* favor: number,
* bonusPercent: number,
* bonusDescription: string,
* }
* }
* </pre>
*
*/
getStats(): Partial<Record<GoOpponent, SimpleOpponentStats>>;
};
/**