Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some way to allow reordering players #758

Open
jkomoros opened this issue Apr 12, 2020 · 1 comment
Open

Some way to allow reordering players #758

jkomoros opened this issue Apr 12, 2020 · 1 comment

Comments

@jkomoros
Copy link
Owner

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

@jkomoros
Copy link
Owner Author

Another (complementary?) option is to have GameDelegate have ReversePlayerOrder(state ImmutableState) bool (originally captured in #755)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant