法相逻辑优化
parent
d94b80840e
commit
7d947c5b78
|
@ -60,7 +60,7 @@ public class EquipManager extends MongoBase {
|
|||
return equipMap;
|
||||
}
|
||||
|
||||
public void addFaxiang(Faxiang faxiang) {
|
||||
public void putFaxiang(Faxiang faxiang) {
|
||||
this.faxiangMap.put(faxiang.getId(),faxiang);
|
||||
updateString("faxiangMap." + faxiang.getId(), faxiang);
|
||||
}
|
||||
|
|
|
@ -1,22 +1,18 @@
|
|||
package com.ljsd.jieling.logic.dao;
|
||||
|
||||
import com.ljsd.common.mogodb.MongoBase;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.util.KeyGenUtils;
|
||||
import com.ljsd.jieling.util.UUIDEnum;
|
||||
|
||||
public class Faxiang extends MongoBase {
|
||||
public class Faxiang {
|
||||
private String id;
|
||||
private int itemId;
|
||||
private int strongLv;
|
||||
private int star;
|
||||
|
||||
public Faxiang() {
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
}
|
||||
|
||||
public Faxiang(int uid,int itemId) {
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
this.id = KeyGenUtils.produceIdByModule(UUIDEnum.Faxiang, uid);
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
@ -27,7 +23,6 @@ public class Faxiang extends MongoBase {
|
|||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
updateString("id", id);
|
||||
}
|
||||
|
||||
public int getItemId() {
|
||||
|
@ -36,7 +31,6 @@ public class Faxiang extends MongoBase {
|
|||
|
||||
public void setItemId(int itemId) {
|
||||
this.itemId = itemId;
|
||||
updateString("itemId", itemId);
|
||||
}
|
||||
|
||||
public int getStrongLv() {
|
||||
|
@ -45,12 +39,10 @@ public class Faxiang extends MongoBase {
|
|||
|
||||
public void setStrongLv(int strongLv) {
|
||||
this.strongLv = strongLv;
|
||||
updateString("strongLv", strongLv);
|
||||
}
|
||||
|
||||
public void addStrongLv(int Lv) {
|
||||
this.strongLv += Lv;
|
||||
updateString("strongLv", strongLv);
|
||||
}
|
||||
|
||||
public int getStar() {
|
||||
|
@ -59,11 +51,6 @@ public class Faxiang extends MongoBase {
|
|||
|
||||
public void setStar(int star) {
|
||||
this.star = star;
|
||||
updateString("star", star);
|
||||
}
|
||||
|
||||
public void addStar(int lv) {
|
||||
this.star += lv;
|
||||
updateString("star", star);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -204,6 +204,7 @@ public class EquipLogic {
|
|||
ItemUtil.itemCostLong(user,costMap, BIReason.UP_FAXIANG_EQUIP_LV_COST,0);
|
||||
costFaxiang(user, equipCostStr.toString(), true);
|
||||
}
|
||||
equipManager.putFaxiang(faxiang);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -278,6 +279,6 @@ public class EquipLogic {
|
|||
equips.add(proto);
|
||||
}
|
||||
PlayerInfoProto.GetAllFaxiangEquipResponse build = PlayerInfoProto.GetAllFaxiangEquipResponse.newBuilder().addAllEquips(equips).setIsFinish(isFinish).build();
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GET_ALL_EQUIP_RESPONSE_VALUE, build, true);
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GET_ALL_FAXIANG_EQUIP_RESPONSE_VALUE, build, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1337,7 +1337,7 @@ public class ItemUtil {
|
|||
// 法相
|
||||
if(itemType == GlobalItemType.FAXIANG_EQUIP){
|
||||
Faxiang faxiang = new Faxiang(user.getId(), equipId);
|
||||
equipManager.addFaxiang(faxiang);
|
||||
equipManager.putFaxiang(faxiang);
|
||||
jewelList.add(CBean2Proto.getFaxiangEquipProto(faxiang));
|
||||
}
|
||||
// 走马灯
|
||||
|
|
Loading…
Reference in New Issue