Skip to content

Commit

Permalink
fix major bug in players distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
akmsw committed Jan 3, 2024
1 parent dc62dcf commit 5be5801
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public List<Team> withoutAnchorages(List<Team> teams) {
Map<Position, List<Player>> playersMap = CommonFields.getPlayersSets();

for (Position position : Position.values()) {
List<Player> currentPlayersSet = playersMap.get(position);
List<Player> currentPlayersSet = new ArrayList<>(playersMap.get(position));

// Players sorted highest to lowest
currentPlayersSet.sort(comparingInt(Player::getSkillPoints).reversed());
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/armameeldoparti/utils/mixers/RandomMixer.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import armameeldoparti.utils.common.CommonFields;
import armameeldoparti.utils.common.CommonFunctions;
import armameeldoparti.utils.common.Constants;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -63,7 +64,7 @@ public List<Team> withoutAnchorages(List<Team> teams) {
.getTeamPlayers();

for (Position position : Position.values()) {
List<Player> playersAtPosition = playersSets.get(position);
List<Player> playersAtPosition = new ArrayList<>(playersSets.get(position));

Collections.shuffle(playersAtPosition);

Expand Down

0 comments on commit 5be5801

Please sign in to comment.