-
Notifications
You must be signed in to change notification settings - Fork 153
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
Don't rotate the player assigned to the role 'random' when generating… #86
base: master
Are you sure you want to change the base?
Conversation
… multiple matches The current code rotates all players when generating multiple matches for the same game. This change leaves the player associated with the 'random' role at the same index in the player list and rotates all the other players. If there is no player associated with the 'random' role, the code works as before.
Sorry for the slow response here. Was travelling; now catching up on everything I missed. This is on my radar. |
Some initial thoughts:
|
Sam, I agree with you on both points. I will spend some time on these and send along my proposed solutions. Do you plan on checking this in in the current state? It might take me a week or two to get back to this. |
Sam, not a problem on the delay. I figured you might be on vacation or travelling. |
@@ -244,10 +244,38 @@ public void actionPerformed(ActionEvent evt) { | |||
thePlayers.add(playerSelector.getPlayerPresence(name)); | |||
} | |||
|
|||
StateMachine stateMachine = new ProverStateMachine(); | |||
stateMachine.initialize(theGame.getRules()); | |||
List<Role> roles = stateMachine.getRoles(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use Role#computeRoles for this.
… multiple matches
The current code rotates all players when generating multiple matches
for the same game. This change leaves the player associated with the
'random' role at the same index in the player list and rotates all the
other players. If there is no player associated with the 'random' role,
the code works as before.