Skip to content

Commit c56d9b9

Browse files
authored
Adding playerID to Ctx (#627)
This is available and used in several games on FBG right now: https://github.com/freeboardgames/FreeBoardGames.org/blob/df037cc12e21948acfb63a90e6dd4cb088851ea4/src/games/takesix/game.ts#L50 https://github.com/freeboardgames/FreeBoardGames.org/blob/6317daad1079430257dc2648b85c61e393a071fd/src/games/secretcodes/util.ts#L11 It is especially important for knowing which user played when multiple users can play in the same turn (the currentPlayer in that case does not mean much)
1 parent 80383ec commit c56d9b9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export interface Ctx {
4848
numPlayers: number;
4949
playOrder: Array<PlayerID>;
5050
playOrderPos: number;
51+
playerID?: PlayerID;
5152
activePlayers: null | ActivePlayers;
5253
currentPlayer: PlayerID;
5354
numMoves?: number;

0 commit comments

Comments
 (0)