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

📄 abstractambulanceteamagent.java

📁 机器人设计的Java源程序,提供给大家参考参考
💻 JAVA
字号:
// Copyright (C) 2002 Takeshi Morimoto <morimoto@takopen.cs.uec.ac.jp>// All rights reserved.package yab.agent;import java.net.*;import yab.agent.*;import yab.agent.object.*;import yab.io.ProtocolConstants;public abstract class AbstractAmbulanceTeamAgent extends PlatoonAgent {    protected AbstractAmbulanceTeamAgent(InetAddress address, int port) {        super(ProtocolConstants.AGENT_TYPE_AMBULANCE_TEAM, address, port);    }    protected AmbulanceTeam self() { return (AmbulanceTeam) world.self; }    private Humanoid m_loadingInjured = null;    protected Humanoid loadingInjured() { return m_loadingInjured; }    protected boolean isLoadingInjured() { return m_loadingInjured != null; }    protected void checkLoadingInjured() {        if (loadingInjured() instanceof Humanoid            && loadingInjured().position() != self())            m_loadingInjured = null;    }    protected void prepareForAct() {        super.prepareForAct();        checkLoadingInjured();    }    protected void rescue(Humanoid target) throws ActionCommandException {        socket().akRescue(self().id, target.id);        throw new ActionCommandException();    }    protected void load(Humanoid target) throws ActionCommandException {        socket().akLoad(self().id, target.id);        m_loadingInjured = target;        throw new ActionCommandException();    }    protected void unload() throws ActionCommandException {        socket().akUnload(self().id);        m_loadingInjured = null;        throw new ActionCommandException();    }}

⌨️ 快捷键说明

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