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

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Vehicle
All Implemented Interfaces:
IWorldChangeEvent, IWorldEvent, IWorldObject, ILocated, ILocomotive, IRotable, IViewable, ICompositeWorldObject, IGBViewable, Event
Direct Known Subclasses:
VehicleCompositeImpl, VehicleMessage

public abstract class Vehicle
extends InfoMessage
implements IWorldEvent, IWorldChangeEvent, ICompositeWorldObject, ILocated, ILocomotive, IRotable, IGBViewable

Abstract definition of the GameBots2004 message VEH.

Complete message documentation: Synchronous message. Holds vehicles we see. Id for vehicles doesn't work, so this message is without Id. We can join vehicles by ENTER command if we are close enough - ussually 100 ut units or less. Note: Vehicle support is in aplha testing right now.


Nested Class Summary
static class Vehicle.ObjectDisappeared
           
static class Vehicle.VehicleUpdate
           
 
Field Summary
static java.lang.String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  long SimTime
           
 
Constructor Summary
Vehicle()
          Parameter-less contructor for the message.
 
Method Summary
 IWorldObjectUpdatedEvent createDisappearEvent()
          Creates an update event that has to update visibility to false.
abstract  java.lang.Integer getArmor()
          How much the vehicle has left.
abstract  UnrealId getDriver()
          Unique Id of the driver - if any.
abstract  java.lang.Integer getHealth()
          How much health the vehicle has left.
abstract  UnrealId getId()
          Unique Id of the vehicle or vehicle part.
abstract  Location getLocation()
          An absolute location of the vehicle within the map.
abstract  Rotation getRotation()
          Which direction the vehicle is facing in absolute terms.
 long getSimTime()
          Returns the simulation time when the event has occurred.
abstract  java.lang.Integer getTeam()
          What team the vehicle is on.
abstract  java.lang.String getType()
          Class of the vehicle.
abstract  Velocity getVelocity()
          Absolute velocity of the vehicle as a vector of movement per one game second.
abstract  boolean isTeamLocked()
          If the vehicle is locked just for its current team.
abstract  boolean isVisible()
          If the vehicle is in the field of view of the bot.
protected  void setSimTime(long SimTime)
          Used by Yylex to slip correct time of the object or programmatically.
 java.lang.String toHtmlString()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface cz.cuni.amis.pogamut.multi.communication.worldview.object.ICompositeWorldObject
getLocal, getShared, getStatic
 

Field Detail

PROTOTYPE

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

See Also:
Constant Field Values

SimTime

protected long SimTime
Constructor Detail

Vehicle

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

Method Detail

getSimTime

public long getSimTime()
Description copied from interface: IWorldEvent
Returns the simulation time when the event has occurred.

Specified by:
getSimTime in interface IWorldChangeEvent
Specified by:
getSimTime in interface IWorldEvent
Specified by:
getSimTime in interface IWorldObject
Returns:
timestamp

setSimTime

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


getId

public abstract UnrealId getId()
Unique Id of the vehicle or vehicle part.

Specified by:
getId in interface IWorldObject
Returns:

getRotation

public abstract Rotation getRotation()
Which direction the vehicle is facing in absolute terms.

Specified by:
getRotation in interface IRotable
Returns:
Current rotation of the object, represented as yaw, roll and pitch.

getLocation

public abstract Location getLocation()
An absolute location of the vehicle within the map.

Specified by:
getLocation in interface ILocated
Returns:
Current location of the object, represented as a point within the world's coordinates.

getVelocity

public abstract Velocity getVelocity()
Absolute velocity of the vehicle as a vector of movement per one game second.

Specified by:
getVelocity in interface ILocomotive
Returns:
Current direction in which the object is moving and absolute velocity of the object within the world. The direction is represented as a vector within the world's coordinates. The size of velocity is represented by length of that vector.

isVisible

public abstract boolean isVisible()
If the vehicle is in the field of view of the bot.

Specified by:
isVisible in interface IViewable
Returns:
True if the object is visible; false otherwise.

getTeam

public abstract java.lang.Integer getTeam()
What team the vehicle is on. 255 is no team. 0-3 are red, blue, green, gold in that order.


getHealth

public abstract java.lang.Integer getHealth()
How much health the vehicle has left. Ranges from 0 to x, depending on the vehicle type.


getArmor

public abstract java.lang.Integer getArmor()
How much the vehicle has left. Note: This may be 0 all the time. Maybe the vehicles are not supporting armor.


getDriver

public abstract UnrealId getDriver()
Unique Id of the driver - if any.


isTeamLocked

public abstract boolean isTeamLocked()
If the vehicle is locked just for its current team.


getType

public abstract java.lang.String getType()
Class of the vehicle. If it is a car, turret etc.


createDisappearEvent

public IWorldObjectUpdatedEvent createDisappearEvent()
Description copied from interface: IGBViewable
Creates an update event that has to update visibility to false.

Specified by:
createDisappearEvent in interface IGBViewable
Returns:

toString

public java.lang.String toString()
Overrides:
toString in class InfoMessage

toHtmlString

public java.lang.String toHtmlString()