爬塔副本信息(试炼副本)

back_recharge
jiahuiwen 2019-06-25 15:28:07 +08:00
parent 9eeabfdbe7
commit 505547fa66
3 changed files with 352 additions and 259 deletions

View File

@ -80,6 +80,12 @@ public class MapManager extends MongoBase {
private int fightCount;
// 爬塔副本重置次数
private int resetCount;
// 爬塔副本试炼精气
private int essenceValue;
// 爬塔副本历史最高层
private int highestTower;
// 爬塔副本商店
private Map<Integer, Integer> towerShopInfos;
public MapManager() {
@ -459,4 +465,36 @@ public class MapManager extends MongoBase {
removeString(getMongoKey() + ".copyMissionProgresMap." + copyId);
this.copyMissionProgresMap.remove(copyId);
}
public int getEssenceValue() {
return essenceValue;
}
public void setEssenceValue(int essenceValue) {
updateString("essenceValue" , essenceValue);
this.essenceValue = essenceValue;
}
public int getHighestTower() {
return highestTower;
}
public void setHighestTower(int highestTower) {
updateString("highestTower" , highestTower);
this.highestTower = highestTower;
}
public Map<Integer, Integer> getTowerShopInfos() {
return towerShopInfos;
}
public void setTowerShopInfos(Map<Integer, Integer> towerShopInfos) {
updateString("towerShopInfos" , towerShopInfos);
this.towerShopInfos = towerShopInfos;
}
public void addOrUpdatetowerShopInfos(int key, int value) {
updateString("towerShopInfos." + key, value);
this.towerShopInfos.put(key, value);
}
}

View File

@ -8,6 +8,7 @@ import com.ljsd.jieling.logic.dao.*;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.protocols.ChatProto;
import com.ljsd.jieling.protocols.CommonProto;
import com.ljsd.jieling.protocols.MapInfoProto;
import java.util.*;
@ -301,4 +302,19 @@ public class CBean2Proto {
return result;
}
public static List<MapInfoProto.TowerShopInfo> getTowerShopInfo(Map<Integer, Integer> towerShopInfos) {
List<MapInfoProto.TowerShopInfo> towerShopInfosProto = new ArrayList<>();
if (towerShopInfos != null) {
for (Map.Entry<Integer, Integer> entry : towerShopInfos.entrySet()) {
MapInfoProto.TowerShopInfo towerShopInfo = MapInfoProto.TowerShopInfo
.newBuilder()
.setGoodsId(entry.getKey())
.setBuyCount(entry.getValue())
.build();
towerShopInfosProto.add(towerShopInfo);
}
}
return towerShopInfosProto;
}
}