地图 8和9 全出现

back_recharge
jiahuiwen 2019-03-01 13:40:22 +08:00
parent 7684ffe7e0
commit 9ff3046493
1 changed files with 18 additions and 11 deletions

View File

@ -96,16 +96,10 @@ public class MapLogic {
}
List<CommonProto.Cell> cells = new ArrayList<>(mapManager.getMapInfo().size());
for (Map.Entry<Integer, Cell> entry : mapManager.getMapInfo().entrySet()) {
Cell cell = entry.getValue();
if (cell.getEventId() == -1) {
continue;
}
CommonProto.Cell cellProto = CommonProto.Cell
.newBuilder()
.setCellId(entry.getKey())
.setPointId(cell.getPointId())
.build();
cells.add(cellProto);
cellToProto(cells, entry);
}
for (Map.Entry<Integer, Cell> entry : mapManager.getTypeEight().entrySet()) {
cellToProto(cells, entry);
}
MapInfoProto.MapEnterResponse mapEnterResponse = MapInfoProto.MapEnterResponse
.newBuilder()
@ -115,6 +109,19 @@ public class MapLogic {
MessageUtil.sendMessage(iSession, 1, messageType.getNumber(), mapEnterResponse, true);
}
private void cellToProto(List<CommonProto.Cell> cells, Map.Entry<Integer, Cell> entry) {
Cell cell = entry.getValue();
if (cell.getEventId() == -1) {
return;
}
CommonProto.Cell cellProto = CommonProto.Cell
.newBuilder()
.setCellId(entry.getKey())
.setPointId(cell.getPointId())
.build();
cells.add(cellProto);
}
public void initMap(MapManager mapManager, User user) throws Exception {
Map<Integer, SCMap> scMap = SCMap.sCMap.get(mapManager.getCurMapId());
@ -157,7 +164,7 @@ public class MapLogic {
if (mapPointConfig.getStyle() == EventType.enter) {
mapManager.setCurXY(xy);
}
if (mapPointConfig.getStyle() == EventType.allEvents) {
if (mapPointConfig.getStyle() == EventType.allEvents || mapPointConfig.getStyle() == EventType.hinder) {
spicelMap.put(xy, cellValue);
} else {
newMap.put(xy, cellValue);