⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unclearmessage.java

📁 2004年robotcup世界冠军源代码
💻 JAVA
字号:
package MRL.Utilities.MessageManagement;import yab.agent.DisasterSpace;import yab.agent.object.*;import java.util.Map;import MRL.Utilities.Partitioning.Path;/** * Created by IntelliJ IDEA. * User: Mohammad * Date: Jul 5, 2005 * Time: 2:14:40 PM *///saeed 85-2-3public class UnClearMessage extends Message{    private int roadId;    public UnClearMessage(RCRObject road)    {        super(Type.UNCLEAR_REPORT, road);        this.roadId = obj.id;    }    char[] toCharArray(Map idToVirtualId)    {        char[] result = new char[length()];        char[] temp = Util.intToCharArray(((Integer) (idToVirtualId.get(new Integer(roadId)))).intValue(), idSize);        Util.copyArray(temp, result, 0, 0, idSize);        return result;    }    protected int length()    {        return staticLength();    }    protected static int staticLength()    {        return idSize;    }    public boolean equals(Object m)    {        if (!(m instanceof UnClearMessage)) return false;        return ((UnClearMessage) m).roadId == roadId;    }    public int hashCode()    {        return roadId;    }    void updateWorld(DisasterSpace world, int time)    {        obj = world.get(roadId);        Road r = (Road) obj;        if (!r.isReportedAsClear() && !r.hasBeenSeen())        {            r.setHearTime(time);            r.setTime(time);            r.setBlock(r.width(), time);        }    }    public UnClearMessage(char[] message, Map virtualIdToId)    {        super(Type.UNCLEAR_REPORT, null);        this.roadId = ((Integer) virtualIdToId.get(new Integer(Util.charArrayToint(message, 0, idSize)))).intValue();    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -