事件点保存

back_recharge
jiahuiwen 2019-04-02 16:39:00 +08:00
parent bf235d3fc9
commit b97039772d
3 changed files with 9 additions and 0 deletions

View File

@ -144,6 +144,9 @@ public class MapLogic {
} }
MapInfoProto.MapEnterResponse.Builder mapEnterResponse = MapInfoProto.MapEnterResponse.newBuilder(); MapInfoProto.MapEnterResponse.Builder mapEnterResponse = MapInfoProto.MapEnterResponse.newBuilder();
for (Map.Entry<Integer, Integer> buffEntry : mapManager.getFoodBufferMap().entrySet()) { for (Map.Entry<Integer, Integer> buffEntry : mapManager.getFoodBufferMap().entrySet()) {
if (buffEntry.getValue() <= 0) {
continue;
}
CommonProto.FoodBuffer foodBuffer = CBean2Proto.getFoodBuffer(buffEntry.getKey(), buffEntry.getValue()); CommonProto.FoodBuffer foodBuffer = CBean2Proto.getFoodBuffer(buffEntry.getKey(), buffEntry.getValue());
mapEnterResponse.addFoodBuffers(foodBuffer); mapEnterResponse.addFoodBuffers(foodBuffer);
} }

View File

@ -93,6 +93,8 @@ public class BehaviorUtil {
Map<Integer, Cell> mapInfo = mapManager.getMapInfo(); Map<Integer, Cell> mapInfo = mapManager.getMapInfo();
Cell cell = mapInfo.get(destoryXY); Cell cell = mapInfo.get(destoryXY);
if (cell != null) { if (cell != null) {
cell.setEventId(-1);
mapManager.addOrUpdateCell(cell.getCellId(), cell);
addRefreshInfo(cell.getPointId(), mapManager); addRefreshInfo(cell.getPointId(), mapManager);
} }
} }
@ -212,6 +214,8 @@ public class BehaviorUtil {
Map<Integer, Cell> mapInfo = mapManager.getMapInfo(); Map<Integer, Cell> mapInfo = mapManager.getMapInfo();
Cell cell = mapInfo.get(mapManager.getCurXY()); Cell cell = mapInfo.get(mapManager.getCurXY());
if (cell != null) { if (cell != null) {
cell.setEventId(-1);
mapManager.addOrUpdateCell(cell.getCellId(), cell);
addRefreshInfo(cell.getPointId(), mapManager); addRefreshInfo(cell.getPointId(), mapManager);
} }
} }
@ -226,6 +230,7 @@ public class BehaviorUtil {
for (Cell cell : mapInfo.values()) { for (Cell cell : mapInfo.values()) {
if (cell.getPointId() == pointId) { if (cell.getPointId() == pointId) {
cell.setEventId(eventId); cell.setEventId(eventId);
user.getMapManager().addOrUpdateCell(cell.getCellId(), cell);
} }
} }
} }

View File

@ -21,6 +21,7 @@ public class TwentyFourBehavior extends BaseBehavior {
for (Cell cell : mapInfos.values()) { for (Cell cell : mapInfos.values()) {
if (cell.getPointId() == behaviorTypeValues[0][0]) { if (cell.getPointId() == behaviorTypeValues[0][0]) {
cell.setEventId(behaviorTypeValues[0][1]); cell.setEventId(behaviorTypeValues[0][1]);
user.getMapManager().addOrUpdateCell(cell.getCellId(), cell);
} }
} }
return true; return true;