Closed delucis closed 4 years ago
We'd also need to change setActivePlayers
to operate on the player that called the event (playerID
) rather that currentPlayer
.
After working on the documentation, I find that it's a bit confusing to have both setStage
and setActivePlayers
. I think we should merge the functionality of setActivePlayers
into setStage
.
EDIT: Implemented in https://github.com/nicolodavis/boardgame.io/commit/f3022716cfa5a51122a4a4d90b5a5c809e688748.
Open to ideas about how to make the arguments to the new setStage
more intuitive. The semantics are currently:
setStage('A')
: take current player to stage.setStage({ stage: 'A', moveLimit: 2 })
: same as the above, but also apply a moveLimit
.setActivePlayers
.EDIT2:
On second thought, I think this causes more confusion about semantics (setStage
doesn't reset move counts but setActivePlayers
does, and revert semantics only apply to setActivePlayers
). I've reverted my change. Still open to merging the two into a single event, but we'd have to simplify them a bit and make sure that the semantics aren't confusing when implemented as one multi-purpose event.
Looks like all the features discussed here are now done.
As discussed in #458, now that active players and stages allow more complex multiplayer play within turns, it makes sense for any active player to be able to call an event (the stage-related events in particular) and not just the current player.
There are two parts:
activePlayers
playerID
to the event handlers, so thatsetStage
andendStage
can operate on the player calling the event rather than always on the current playerI’d offer to tackle this, but I felt a little out of my depth reading the event and reducer logic, so it might be safer for someone who already understands how those work to make these changes.