当前位置: 首页>>代码示例>>Java>>正文


Java Command类代码示例

本文整理汇总了Java中rescuecore2.messages.Command的典型用法代码示例。如果您正苦于以下问题:Java Command类的具体用法?Java Command怎么用?Java Command使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Command类属于rescuecore2.messages包,在下文中一共展示了Command类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: MrlCommandLayer

import rescuecore2.messages.Command; //导入依赖的package包/类
/**
 * Construct a new CommandLayer.
 */
public MrlCommandLayer() {
    commands = new ArrayList<Command>();
    renderMove = true;
    renderExtinguish = true;
    renderClear = true;
    renderLoad = true;
    renderUnload = true;
    renderRescue = true;
    renderMoveAction = new RenderMoveAction();
    renderExtinguishAction = new RenderExtinguishAction();
    renderClearAction = new RenderClearAction();
    renderRescueAction = new RenderRescueAction();
    renderLoadAction = new RenderLoadAction();
    renderUnloadAction = new RenderUnloadAction();
}
 
开发者ID:MRL-RS,项目名称:visual-debugger,代码行数:19,代码来源:MrlCommandLayer.java

示例2: think

import rescuecore2.messages.Command; //导入依赖的package包/类
@Override
    protected final void think(int time, ChangeSet changed, Collection<Command> heard)
    {
        this.startProcessTime = System.currentTimeMillis();
        if (time <= this.ignoreTime)
        {
            send(new AKSubscribe(getID(), time, 1));
        }
        else {
            this.receiveBeforeEvent(time, changed);
//        try
//        {
            this.manager.receiveMessage(time, heard);
//        } catch (Exception s) { System.out.println("'");}
        }
        this.think(time, changed);

        if (time > this.ignoreTime) {
            this.send(this.manager.createSendMessage(super.getID()));
            this.sendAfterEvent(time, changed);
        }
    }
 
开发者ID:AIT-Rescue,项目名称:AIT-Rescue,代码行数:23,代码来源:CommunicationAgent.java

示例3: viewObject

import rescuecore2.messages.Command; //导入依赖的package包/类
@Override
protected void viewObject(Object o) {
    super.viewObject(o);
    if (o instanceof Command) {
        commands.add((Command) o);
    }
}
 
开发者ID:MRL-RS,项目名称:visual-debugger,代码行数:8,代码来源:MrlCommandLayer.java

示例4: render

import rescuecore2.messages.Command; //导入依赖的package包/类
@Override
public Collection<RenderedObject> render(Graphics2D graphics, ScreenTransform transform, int width, int height) {
    synchronized (commands) {
        Collection<RenderedObject> result = new ArrayList<RenderedObject>();
        g = graphics;
        t = transform;
        for (Command next : commands) {
            if (renderMove && next instanceof AKMove) {
                if (StaticViewProperties.selectedObject != null && (next).getAgentID().equals(StaticViewProperties.selectedObject.getID())) {
                    renderMove((AKMove) next);
                }
            }
            if (renderExtinguish && next instanceof AKExtinguish) {
                renderExtinguish((AKExtinguish) next);
            }
            if (renderClear && next instanceof AKClear) {
                renderClear((AKClear) next);
            }
            if (renderClear && next instanceof AKClearArea) {
                renderClearArea((AKClearArea) next);
            }
            if (renderRescue && next instanceof AKRescue) {
                renderRescue((AKRescue) next);
            }
            if (renderLoad && next instanceof AKLoad) {
                renderLoad((AKLoad) next);
            }
            if (renderUnload && next instanceof AKUnload) {
                renderUnload((AKUnload) next);
            }
        }
        return result;
    }
}
 
开发者ID:MRL-RS,项目名称:visual-debugger,代码行数:35,代码来源:MrlCommandLayer.java

示例5: receiveMessage

import rescuecore2.messages.Command; //导入依赖的package包/类
public void receiveMessage(int time, Collection<Command> heard)
{
	this.kernelTime = time;
	this.receivedMessages.clear();
	this.heardAgentHelp = false;

	for (BitOutputStream bos : bitOutputStreamList)
	{ bos.reset(); }

	for (Command command : heard)
	{
		if (command instanceof AKSpeak)
		{
			if (agentID == command.getAgentID()) { continue; }

			byte[] data = ((AKSpeak)command).getContent();
			if (data.length <= 0) { continue; }

			if (((AKSpeak) command).getChannel() == 0)
			{
				String voice = new String(data);
				if ("Help".equalsIgnoreCase(voice) || "Ouch".equalsIgnoreCase(voice))
				{
					//System.out.println(voice + " : " + command.getAgentID() + " : " );
					this.heardAgentHelp = true;
					continue;
				}
				String[] voiceData =
					voice.split(this.voiceConfig.getMessageSeparator());
				this.receiveVoiceMessage(
						(AKSpeak)command,
						Arrays.copyOfRange(voiceData, 1, voiceData.length - 1),
						this.receivedMessages);
				// TODO: refactoring
			}
			else
			{
				this.receiveRadioMessage((AKSpeak)command, this.receivedMessages);
			}
		}
	}
}
 
开发者ID:AIT-Rescue,项目名称:AIT-Rescue,代码行数:43,代码来源:MessageManager.java


注:本文中的rescuecore2.messages.Command类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。