Skip to content

Commit 7c65046

Browse files
committed
fix redacted move example
1 parent 4a468ab commit 7c65046

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

examples/react-web/src/redacted-move/board.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ const Board = ({ G, ctx, moves, playerID, log }) => (
2020
<pre>{JSON.stringify(log, null, 2)}</pre>
2121
{playerID && (
2222
<button
23-
onClick={() =>
24-
moves.clickCell({ secret: G.players[ctx.currentPlayer] })
25-
}
23+
onClick={() => moves.clickCell({ secret: G.players[playerID] })}
2624
>
2725
Click Cell
2826
</button>

examples/react-web/src/redacted-move/game.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,29 @@
66
* https://opensource.org/licenses/MIT.
77
*/
88

9-
import { PlayerView, TurnOrder } from 'boardgame.io/core';
9+
import { PlayerView, ActivePlayers } from 'boardgame.io/core';
1010

1111
const RedactedMoves = {
1212
name: 'secret-state',
1313

1414
setup: () => ({
1515
other: {},
1616
players: {
17-
0: 'player 0 state',
18-
1: 'player 1 state',
17+
'0': 'player 0 state',
18+
'1': 'player 1 state',
1919
},
2020
}),
2121

2222
moves: {
2323
clickCell: {
2424
/* eslint-disable no-unused-vars */
25-
impl: (G, ctx, secretstuff) => {
26-
return { ...G };
27-
},
25+
move: (G, ctx, secretstuff) => {},
2826
/* eslint-enable no-unused-vars */
2927
redact: true,
3028
},
3129
},
3230

33-
turn: { order: TurnOrder.ANY },
31+
turn: { activePlayers: ActivePlayers.ALL },
3432

3533
playerView: PlayerView.STRIP_SECRETS,
3634
};

0 commit comments

Comments
 (0)