cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages
Class GiveItemResult

Package class diagram package GiveItemResult
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GiveItemResult
All Implemented Interfaces:
IWorldChangeEvent, IWorldEvent, cz.cuni.amis.utils.listener.Event

public class GiveItemResult
extends InfoMessage
implements IWorldEvent, IWorldChangeEvent

Definition of the event GIVERES.

Complete message documentation: Aynchronous message. Response to GIVE command. Here we get the information about the result of our GIVE command.


Field Summary
protected  UnrealId ItemId
          If the command was a success then here we receive Id of the item that was given to bot.
protected  String ItemType
          Class of the item we wanted to give to the bot.
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  String Reason
          String reason why the give command was or wasn't successful.
protected  Boolean Result
          Boolean result containing whether the give command was successful.
protected  long SimTime
           
protected  UnrealId TargetId
          An Id of the bot we tried to send item to.
 
Constructor Summary
GiveItemResult()
          Parameter-less contructor for the message.
GiveItemResult(GiveItemResult original)
          Cloning constructor from the full message.
GiveItemResult(UnrealId TargetId, UnrealId ItemId, String ItemType, Boolean Result, String Reason)
          Creates new instance of the message GiveItemResult.
 
Method Summary
 UnrealId getItemId()
          If the command was a success then here we receive Id of the item that was given to bot.
 String getItemType()
          Class of the item we wanted to give to the bot.
 String getReason()
          String reason why the give command was or wasn't successful.
 long getSimTime()
          Simulation time in MILLI SECONDS !!!
 UnrealId getTargetId()
          An Id of the bot we tried to send item to.
 Boolean isResult()
          Boolean result containing whether the give command was successful.
protected  void setSimTime(long SimTime)
          Used by Yylex to slip correct time of the object or programmatically.
 String toHtmlString()
           
 String toJsonLiteral()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTOTYPE

public static final String PROTOTYPE
Example how the message looks like - used during parser tests.

See Also:
Constant Field Values

SimTime

protected long SimTime

TargetId

protected UnrealId TargetId
An Id of the bot we tried to send item to.


ItemId

protected UnrealId ItemId
If the command was a success then here we receive Id of the item that was given to bot.


ItemType

protected String ItemType
Class of the item we wanted to give to the bot.


Result

protected Boolean Result
Boolean result containing whether the give command was successful.


Reason

protected String Reason
String reason why the give command was or wasn't successful. Can be BOT_NOT_FOUND_OR_BOT_PAWN_NONE, MAX_DISTANCE_EXCEEDED, WRONG_ITEM_TYPE and SUCCESS.

Constructor Detail

GiveItemResult

public GiveItemResult()
Parameter-less contructor for the message.


GiveItemResult

public GiveItemResult(UnrealId TargetId,
                      UnrealId ItemId,
                      String ItemType,
                      Boolean Result,
                      String Reason)
Creates new instance of the message GiveItemResult. Aynchronous message. Response to GIVE command. Here we get the information about the result of our GIVE command. Corresponding GameBots message is GIVERES.

Parameters:
TargetId - An Id of the bot we tried to send item to.
ItemId - If the command was a success then here we receive Id of the item that was given to bot.
ItemType - Class of the item we wanted to give to the bot.
Result - Boolean result containing whether the give command was successful.
Reason - String reason why the give command was or wasn't successful. Can be BOT_NOT_FOUND_OR_BOT_PAWN_NONE, MAX_DISTANCE_EXCEEDED, WRONG_ITEM_TYPE and SUCCESS.

GiveItemResult

public GiveItemResult(GiveItemResult original)
Cloning constructor from the full message.

Parameters:
original -
Method Detail

getSimTime

public long getSimTime()
Simulation time in MILLI SECONDS !!!

Specified by:
getSimTime in interface IWorldChangeEvent
Specified by:
getSimTime in interface IWorldEvent

setSimTime

protected void setSimTime(long SimTime)
Used by Yylex to slip correct time of the object or programmatically.


getTargetId

public UnrealId getTargetId()
An Id of the bot we tried to send item to.


getItemId

public UnrealId getItemId()
If the command was a success then here we receive Id of the item that was given to bot.


getItemType

public String getItemType()
Class of the item we wanted to give to the bot.


isResult

public Boolean isResult()
Boolean result containing whether the give command was successful.


getReason

public String getReason()
String reason why the give command was or wasn't successful. Can be BOT_NOT_FOUND_OR_BOT_PAWN_NONE, MAX_DISTANCE_EXCEEDED, WRONG_ITEM_TYPE and SUCCESS.


toString

public String toString()
Overrides:
toString in class InfoMessage

toHtmlString

public String toHtmlString()

toJsonLiteral

public String toJsonLiteral()
Overrides:
toJsonLiteral in class InfoMessage


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.