Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
3c94bd5324
@ -90,6 +90,11 @@ public class VoteHandler {
|
||||
passengers[ghostPosition] = g;
|
||||
passengers[ghostPosition].send(
|
||||
"You are now a ghost!"); // TODO: ServerGameInfoHandler might deal with this one
|
||||
|
||||
// set hasVoted to false for all passengers for future votings
|
||||
for (Passenger passenger : passengers) {
|
||||
passenger.setHasVoted(false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -100,7 +105,7 @@ public class VoteHandler {
|
||||
*
|
||||
* @param passengers: train passengers
|
||||
*/
|
||||
public void humanVote(Passenger[] passengers) {
|
||||
public void humanVote(Passenger[] passengers, Game game) {
|
||||
|
||||
// array to collect votes for all players during voting, i.e. votes for player 1 are saved in
|
||||
// votesForPlayers[0]
|
||||
@ -176,5 +181,9 @@ public class VoteHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
// set hasVoted to false for all passengers for future votings
|
||||
for (Passenger passenger : passengers) {
|
||||
passenger.setHasVoted(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,9 +71,9 @@ public class Passenger {
|
||||
// changes this passenger's status from human to ghost
|
||||
isGhost = true;
|
||||
}
|
||||
public void setHasVoted() {
|
||||
public void setHasVoted(boolean voted) {
|
||||
// used to signal that this passenger voted during a voting
|
||||
hasVoted = true;
|
||||
hasVoted = voted;
|
||||
}
|
||||
|
||||
public int getPosition() {
|
||||
|
||||
Reference in New Issue
Block a user