MCPcopy Create free account
hub / github.com/Card-Forge/forge / isMatchOver

Method isMatchOver

forge-game/src/main/java/forge/game/Match.java:125–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

123 }
124
125 public boolean isMatchOver() {
126 int[] victories = new int[players.size()];
127 for (GameOutcome go : getOutcomes()) {
128 LobbyPlayer winner = go.getWinningLobbyPlayer();
129 int i = 0;
130 for (RegisteredPlayer p : players) {
131 if (p.getPlayer().equals(winner)) {
132 victories[i]++;
133 if (victories[i] >= rules.getGamesToWinMatch()) {
134 return true;
135 }
136 }
137 i++;
138 }
139 }
140
141 // Games are first to X wins, not first to X wins or Y total games played
142 return false;
143 }
144
145 public int getGamesWonBy(LobbyPlayer questPlayer) {
146 int sum = 0;

Callers 5

getWinnerMethod · 0.95
updateFromTournamentMethod · 0.95
runTournamentMethod · 0.95
simulateMethod · 0.95
simulateTournamentMethod · 0.95

Calls 6

getOutcomesMethod · 0.95
getWinningLobbyPlayerMethod · 0.80
getGamesToWinMatchMethod · 0.80
sizeMethod · 0.65
getPlayerMethod · 0.65
equalsMethod · 0.45

Tested by 1

runTournamentMethod · 0.76