【发布时间】:2020-04-17 09:17:11
【问题描述】:
所以我正在制作一个插件,我想将两个ArrayList(来自两个不同的团队)放到一个Hashmap 中,这样我就可以通过这种方法获得两个团队:
public static Teams getTeam(Player player) {
if (!hasTeam(player))
return null;
return zombiesTeam.get(player) && survivorsTeam.get(player);
}
这是我想要的两个ArrayList 和一个Hashmap:
public static HashMap<zombiesTeam, survivorsTeam> playerTeams = new HashMap<zombiesTeam, survivorsTeam>();
public static ArrayList<Player> zombiesTeam = new ArrayList<Player>();
public static ArrayList<Player> survivorsTeam = new ArrayList<Player>();
附:我知道这段代码不正确
请向我询问更多信息
提前致谢。
【问题讨论】:
-
两支球队都有什么意思?我不明白你真正希望做什么?
-
你可以使用
Stream.concat().collection()。