package eu.mhsl.minenet.minigames.score;

import eu.mhsl.minenet.minigames.util.MapUtil;
import net.minestom.server.entity.Player;

import java.util.Set;

public class LowestPointsWinScore extends PointsWinScore {
    @Override
    protected void insertResultImplementation(Set<Player> p, int currentPoints) {
        this.scoreOrder.put(p, currentPoints);
        this.scoreOrder = MapUtil.sortReversedByValue(this.scoreOrder);
        getScores().clear();
        this.scoreOrder.forEach((player, integer) -> getScores().addFirst(player));
    }
}
