You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now the order of players is always set. But in different rounds, you want a different order for players, and you might want to swap it based on roles, etc.
This can get really complex if you allow the order to change lots of thing.
The best way to do it is likely just have a GameDelegate.CustomPlayerOrder() []PlayerIndex .
That must return either nil (default) or each player index from 0 to len(players) -1, in whatever order it wants. The only effect it has is that PlayerIndex.Next() and Prev() will have their order changed. Now those will look up the current player's index in that, then increment the index within THAT and see which player that means is now active.
And you can imagine a behavior for GameState that you can embed that has the player Index slice and that GameDelegate's CustomPlayerOrder uses if it exists.
Ideally this player order and grouping would show up in the player roster rendering. That's probably better handled in e.g. #749
The text was updated successfully, but these errors were encountered:
Related to #752 .
Right now the order of players is always set. But in different rounds, you want a different order for players, and you might want to swap it based on roles, etc.
This can get really complex if you allow the order to change lots of thing.
The best way to do it is likely just have a GameDelegate.CustomPlayerOrder() []PlayerIndex .
That must return either nil (default) or each player index from 0 to len(players) -1, in whatever order it wants. The only effect it has is that PlayerIndex.Next() and Prev() will have their order changed. Now those will look up the current player's index in that, then increment the index within THAT and see which player that means is now active.
And you can imagine a behavior for GameState that you can embed that has the player Index slice and that GameDelegate's CustomPlayerOrder uses if it exists.
Ideally this player order and grouping would show up in the player roster rendering. That's probably better handled in e.g. #749
The text was updated successfully, but these errors were encountered: