Skip to content

Commit 652c46b

Browse files
delucisnicolodavis
authored andcommitted
docs: Document long-form move limit syntax for setActivePlayers (#483)
1 parent 1b767c8 commit 652c46b

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

docs/documentation/stages.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,27 @@ const game = {
150150
<iframe class='plain' src='snippets/stages-1' height='160' scrolling='no' title='example' frameborder='no' allowtransparency='true' allowfullscreen='true' style='width: 100%;'></iframe>
151151
```
152152

153+
#### Advanced Move Limits
154+
155+
Passing a `moveLimit` argument to `setActivePlayers` limits all the
156+
active players to making that number of moves, but sometimes you might want
157+
to set different move limits for different players. For cases like this,
158+
`setStage` and `setActivePlayers` support long-form arguments:
159+
160+
```js
161+
setStage({ stage: 'stage-name', moveLimit: 3 });
162+
```
163+
164+
```js
165+
setActivePlayers({
166+
player: { stage: 'stage-name', moveLimit: 2 },
167+
others: { stage: 'stage-name', moveLimit: 1 },
168+
value: {
169+
'0': { stage: 'stage-name', moveLimit: 4 },
170+
},
171+
});
172+
```
173+
153174
### Stage.NULL
154175

155176
Sometimes you want to add a player to the set of active players

0 commit comments

Comments
 (0)