增加行为类型24

back_recharge
jiahuiwen 2019-03-25 17:50:58 +08:00
parent bb6c70c8f5
commit 96379e36f5
3 changed files with 32 additions and 3 deletions

View File

@ -76,6 +76,7 @@ public class EventType {
public static final int monitorMissionAndMove = 19; public static final int monitorMissionAndMove = 19;
public static final int destroyPointAnd = 20; public static final int destroyPointAnd = 20;
public static final int twentyFour = 24;
public static final int twentyFive = 25; public static final int twentyFive = 25;
public static final int openAppointMission = 26; public static final int openAppointMission = 26;
public static final int openNotDoMission = 27; public static final int openNotDoMission = 27;

View File

@ -104,9 +104,9 @@ public class MapLogic {
if (scMap == null) { if (scMap == null) {
return; return;
} }
if (mapId > mapManager.getCurMapId()) { // if (mapId > mapManager.getMaxMapId()) {
return; // return;
} // }
// SCMapConfig scMapConfig = SCMapConfig.getsCMapSize().get(mapId); // SCMapConfig scMapConfig = SCMapConfig.getsCMapSize().get(mapId);
// if (energy < scMapConfig.getEnergyConfused()) { // if (energy < scMapConfig.getEnergyConfused()) {
// LOGGER.info("enterMap() uid=>{} energy=>{} need=>{} energy not enough ", uid, energy, scMapConfig.getEnergyConfused()); // LOGGER.info("enterMap() uid=>{} energy=>{} need=>{} energy not enough ", uid, energy, scMapConfig.getEnergyConfused());

View File

@ -0,0 +1,28 @@
package com.ljsd.jieling.handler.map.behavior;
import com.ljsd.jieling.handler.map.Cell;
import com.ljsd.jieling.handler.map.EventType;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.protocols.MapInfoProto;
import org.springframework.stereotype.Component;
import java.util.Map;
@Component
public class TwentyFourBehavior extends BaseBehavior {
@Override
public int getBehaviorType() {
return EventType.twentyFour;
}
@Override
public boolean process(User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
Map<Integer, Cell> mapInfos = user.getMapManager().getMapInfo();
for (Cell cell : mapInfos.values()) {
if (cell.getPointId() == behaviorTypeValues[0][0]) {
cell.setEventId(behaviorTypeValues[0][1]);
}
}
return true;
}
}