cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages
Class AliveMessage

Package class diagram package AliveMessage
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.udk.communication.messages.GBObjectUpdate
          extended by cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.AliveMessage
All Implemented Interfaces:
IWorldChangeEvent, IWorldObjectUpdatedEvent, IWorldObject, IGBWorldObjectEvent, cz.cuni.amis.utils.listener.Event

public class AliveMessage
extends GBObjectUpdate
implements IGBWorldObjectEvent, IWorldObject

Synchronous message. Alive message are for confirmation, that the connection is still working. They are sent periodically with usual period of one second (this can change depending on the configuration of ControlServer) Corresponding GameBots message is ALIVE.


Nested Class Summary
 
Nested classes/interfaces inherited from interface cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdatedEvent
IWorldObjectUpdatedEvent.DestroyWorldObject
 
Field Summary
static UnrealId AliveMessageId
           
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  double Time
          Game time when this message was send.
 
Constructor Summary
AliveMessage()
          Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
AliveMessage(AliveMessage original)
          Cloning constructor.
AliveMessage(double Time)
          Creates new instance of command AliveMessage.
 
Method Summary
 boolean equals(Object obj)
           
 UnrealId getId()
           
 double getLastSeenTime()
           
 ILocalWorldObject getLocal()
           
 IWorldObject getObject()
          Returns original object (if method update() has already been called, for bot-programmer that is always true as the original object is updated and then the event is propagated).
 ISharedWorldObject getShared()
           
 long getSimTime()
           
 IStaticWorldObject getStatic()
           
 double getTime()
          Game time when this message was send.
 int hashCode()
           
protected  void setTime(double time)
           
 String toHtmlString()
           
 String toString()
           
 IWorldObjectUpdateResult update(IWorldObject obj)
           
 
Methods inherited from class cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
toJsonLiteral
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, 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

Time

protected double Time
Game time when this message was send.


AliveMessageId

public static final UnrealId AliveMessageId
Constructor Detail

AliveMessage

public AliveMessage(double Time)
Creates new instance of command AliveMessage. Synchronous message. Alive message are for confirmation, that the connection is still working. They are sent periodically with usual period of one second (this can change depending on the configuration of ControlServer) Corresponding GameBots message for this command is .

Parameters:
Time - Game time when this message was send.

AliveMessage

public AliveMessage(AliveMessage original)
Cloning constructor.


AliveMessage

public AliveMessage()
Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).

Method Detail

getTime

public double getTime()
Game time when this message was send.


getId

public UnrealId getId()
Specified by:
getId in interface IWorldObjectUpdatedEvent
Specified by:
getId in interface IWorldObject

setTime

protected void setTime(double time)

getLastSeenTime

public double getLastSeenTime()

getLocal

public ILocalWorldObject getLocal()

getShared

public ISharedWorldObject getShared()

getStatic

public IStaticWorldObject getStatic()

getSimTime

public long getSimTime()
Specified by:
getSimTime in interface IWorldChangeEvent
Specified by:
getSimTime in interface IWorldObject

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

update

public IWorldObjectUpdateResult update(IWorldObject obj)
Specified by:
update in interface IWorldObjectUpdatedEvent

getObject

public IWorldObject getObject()
Returns original object (if method update() has already been called, for bot-programmer that is always true as the original object is updated and then the event is propagated).


toString

public String toString()
Overrides:
toString in class InfoMessage

toHtmlString

public String toHtmlString()


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