📄 clearmessage.java
字号:
package MRL.Utilities.MessageManagement;import yab.agent.DisasterSpace;import yab.agent.object.Road;import java.util.Map;/** * Created by IntelliJ IDEA. * User: Maryam * Date: Apr 27, 2005 * Time: 4:51:37 PM * To change this template use File | Settings | File Templates. *///saeed 85-2-3public class ClearMessage extends Message{ private int roadId; public ClearMessage(Road road) { super(Type.CLEAR_REPORT, road); roadId = road.id; } public ClearMessage(int roadId, Map virtualToIds) { super(Type.CLEAR_REPORT, null); this.roadId = ((Integer) virtualToIds.get(new Integer(roadId))).intValue(); } public ClearMessage(char[] message, Map virtualIdToId) { super(Type.CLEAR_REPORT, null); this.roadId = ((Integer) virtualIdToId.get(new Integer(Util.charArrayToint(message, 0, idSize)))).intValue(); } protected static int staticLength() { return idSize; } public boolean equals(Object m) { if (!(m instanceof ClearMessage)) return false; return roadId == ((ClearMessage) m).roadId; } public int hashCode() { return roadId; } void updateWorld(DisasterSpace world, int time) { obj = world.get(roadId); obj.setHearTime(time); obj.setTime(time); ((Road) obj).setIsReportedAsClear(true); ((Road) obj).setBlock(0,time); } char[] toCharArray(Map idToVirtualIds) // id { char[] result = new char[length()]; char[] temp = Util.intToCharArray(((Integer) idToVirtualIds.get(new Integer(roadId))).intValue(), idSize); Util.copyArray(temp, result, 0, 0, idSize); return result; } protected int length() { return staticLength(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -