Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/main/java/fun/asgard/internal/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@

public class Utils {

public static HashSet<GamePlayer> getValuesFromHashMap(HashMap<Player, GamePlayer> map) {
HashSet<GamePlayer> res = new HashSet<>();
map.forEach((k, a) -> res.add(a));
return res;
public static <K, V> HashSet<V> getValuesFromHashMap(HashMap<K, V> map) {
return new HashSet<>(map.values());
}

public static double getRandom(double min, double max){
return (Math.random() * ((max - min) + 1)) + min;
}

}