心愿, 优化
parent
58337cc318
commit
35723bfbef
|
@ -410,12 +410,12 @@ public class HeroLogic{
|
|||
|
||||
// 计算权重map
|
||||
HashMap<Integer, Integer> map = new HashMap<>(4);
|
||||
for (int i = 0; i < cardInfoMap.size(); i++) {
|
||||
if (cardInfoMap.get(i+1).getStatus() == 1){
|
||||
for (Integer key : cardInfoMap.keySet()) {
|
||||
if (cardInfoMap.get(key).getStatus() == 1){
|
||||
// 已经抽中得格子去除
|
||||
continue;
|
||||
}
|
||||
map.put(i+1,value);
|
||||
map.put(key,value);
|
||||
}
|
||||
int sum = map.values().stream().mapToInt(Integer::intValue).sum();
|
||||
// 这里添加得是空格子, key随便填,只要不和之前重复既可. 目前用的总权重数负值当key
|
||||
|
|
Loading…
Reference in New Issue