非空验证
parent
e8c2e92c13
commit
a6d7f97a43
|
@ -4,6 +4,7 @@ import com.ljsd.jieling.logic.dao.Faxiang;
|
|||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.Jewel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -54,9 +55,9 @@ public class HelpHero {
|
|||
/**
|
||||
* 家园装备强化信息
|
||||
*/
|
||||
private Map<Integer, Integer> homeEquipMap = new HashMap<>(5);
|
||||
private final Map<Integer, Integer> homeEquipMap = new HashMap<>(5);
|
||||
|
||||
private List<Faxiang> faxiangs;
|
||||
private List<Faxiang> faxiangs = new ArrayList<>();
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
|
|
|
@ -2066,6 +2066,7 @@ public class HeroLogic {
|
|||
|
||||
//法相
|
||||
Map<String, Faxiang> faxiangMap = heroVo.getFaxiangMap();
|
||||
if (faxiangMap != null && !faxiangMap.isEmpty()){
|
||||
for (Faxiang faxiang : faxiangMap.values()) {
|
||||
SFaxiangConfig faxiangConfig = SFaxiangConfig.faxiangMap.get(faxiang.getItemId());
|
||||
if (faxiangConfig == null){
|
||||
|
@ -2075,6 +2076,7 @@ public class HeroLogic {
|
|||
skillList.add(faxiangConfig.getPassiveSkill()[i][0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 神印套装
|
||||
Iterator<Map.Entry<Integer, Integer>> godSealIterator = godSealByPositionMap.entrySet().iterator();
|
||||
|
@ -3104,6 +3106,7 @@ public class HeroLogic {
|
|||
|
||||
// 法相加成
|
||||
Set<String> faxiangList = hero.getFaxiangList();
|
||||
if (faxiangList != null && !faxiangList.isEmpty()){
|
||||
for (String id : faxiangList) {
|
||||
Faxiang faxiang = equipManager.getFaxiang(id);
|
||||
SFaxiangConfig config = SFaxiangConfig.faxiangMap.get(faxiang.getItemId());
|
||||
|
@ -3119,6 +3122,7 @@ public class HeroLogic {
|
|||
}
|
||||
combinedAttribute(property, heroAllAttribute);
|
||||
}
|
||||
}
|
||||
|
||||
//魂印
|
||||
Map<Integer, Integer> soulEquipByPositionMap = hero.getSoulEquipByPositionMap();
|
||||
|
|
|
@ -252,7 +252,10 @@ public class CBean2Proto {
|
|||
helpHero.getJewels().forEach(item->jewels.add(getEquipProto(item)));
|
||||
// 法相
|
||||
List<CommonProto.Equip> faxiang = new ArrayList<>();
|
||||
helpHero.getFaxiangs().forEach(item->faxiang.add(getFaxiangEquipProto(item)));
|
||||
List<Faxiang> faxiangs = helpHero.getFaxiangs();
|
||||
if (faxiangs != null && !faxiangs.isEmpty()){
|
||||
faxiangs.forEach(item->faxiang.add(getFaxiangEquipProto(item)));
|
||||
}
|
||||
// 装备详细信息
|
||||
List<CommonProto.Equip> equips = new ArrayList<>();
|
||||
Map<Integer, Integer> equip = helpHero.getHero().getEquipByHongmengPositionMap(otherUser.getHeroManager());
|
||||
|
@ -1428,12 +1431,14 @@ public class CBean2Proto {
|
|||
|
||||
/**
|
||||
* 本服,获取法相
|
||||
* @return
|
||||
*/
|
||||
public static Map<String, Faxiang> faxiangOfLocal(User user, Hero hero){
|
||||
HashMap<String, Faxiang> result = new HashMap<>();
|
||||
try {
|
||||
Map<String, Faxiang> faxiangMap = user.getEquipManager().getFaxiangMap();
|
||||
if (faxiangMap == null || faxiangMap.isEmpty()){
|
||||
return result;
|
||||
}
|
||||
for (String faxiangId : hero.getFaxiangList()) {
|
||||
Faxiang faxiang = faxiangMap.get(faxiangId);
|
||||
if (faxiang == null){
|
||||
|
|
Loading…
Reference in New Issue