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

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

public class VehicleMessage
extends Vehicle
implements IWorldObjectUpdatedEvent

Implementation of the GameBots2004 message VEH contains also its Local/Shared/Static subpart class definitions..

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
 class VehicleMessage.VehicleLocalMessage
          Implementation of the local part of the GameBots2004 message VEH, used to facade VEHMessage.
 class VehicleMessage.VehicleSharedMessage
          Implementation of the shared part of the GameBots2004 message VEH, used to facade VEHMessage.
 class VehicleMessage.VehicleStaticMessage
          Implementation of the static part of the GameBots2004 message VEH, used to facade VEHMessage.
 
Nested classes/interfaces inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Vehicle
Vehicle.ObjectDisappeared, Vehicle.VehicleUpdate
 
Field Summary
protected  java.lang.Integer Armor
          How much the vehicle has left.
protected  UnrealId Driver
          Unique Id of the driver - if any.
protected  java.lang.Integer Health
          How much health the vehicle has left.
protected  UnrealId Id
          Unique Id of the vehicle or vehicle part.
protected  Location Location
          An absolute location of the vehicle within the map.
protected  Rotation Rotation
          Which direction the vehicle is facing in absolute terms.
protected  java.lang.Integer Team
          What team the vehicle is on.
protected  ITeamId TeamId
           
protected  boolean TeamLocked
          If the vehicle is locked just for its current team.
protected  java.lang.String Type
          Class of the vehicle.
protected  Velocity Velocity
          Absolute velocity of the vehicle as a vector of movement per one game second.
protected  boolean Visible
          If the vehicle is in the field of view of the bot.
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Vehicle
PROTOTYPE, SimTime
 
Constructor Summary
VehicleMessage()
          Parameter-less contructor for the message.
VehicleMessage(UnrealId Id, Rotation Rotation, Location Location, Velocity Velocity, boolean Visible, java.lang.Integer Team, java.lang.Integer Health, java.lang.Integer Armor, UnrealId Driver, boolean TeamLocked, java.lang.String Type)
          Creates new instance of the message Vehicle.
VehicleMessage(VehicleMessage original)
          Cloning constructor from the full message.
 
Method Summary
 java.lang.Integer getArmor()
          How much the vehicle has left.
 UnrealId getDriver()
          Unique Id of the driver - if any.
 java.lang.Integer getHealth()
          How much health the vehicle has left.
 UnrealId getId()
          Unique Id of the vehicle or vehicle part.
 VehicleLocal getLocal()
           
 Location getLocation()
          An absolute location of the vehicle within the map.
 Rotation getRotation()
          Which direction the vehicle is facing in absolute terms.
 VehicleShared getShared()
           
 VehicleStatic getStatic()
           
 java.lang.Integer getTeam()
          What team the vehicle is on.
 ITeamId getTeamId()
           
 java.lang.String getType()
          Class of the vehicle.
 Velocity getVelocity()
          Absolute velocity of the vehicle as a vector of movement per one game second.
 boolean isTeamLocked()
          If the vehicle is locked just for its current team.
 boolean isVisible()
          If the vehicle is in the field of view of the bot.
protected  void setTeamId(ITeamId TeamId)
          Used by Yylex to slip corretn TeamId.
 java.lang.String toHtmlString()
           
 java.lang.String toString()
           
 IWorldObjectUpdateResult<IWorldObject> update(IWorldObject object)
           
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Vehicle
createDisappearEvent, getSimTime, setSimTime
 
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.base.communication.translator.event.IWorldChangeEvent
getSimTime
 

Field Detail

TeamId

protected ITeamId TeamId

Id

protected UnrealId Id
Unique Id of the vehicle or vehicle part.


Rotation

protected Rotation Rotation
Which direction the vehicle is facing in absolute terms.


Location

protected Location Location
An absolute location of the vehicle within the map.


Velocity

protected Velocity Velocity
Absolute velocity of the vehicle as a vector of movement per one game second.


Visible

protected boolean Visible
If the vehicle is in the field of view of the bot.


Team

protected java.lang.Integer Team
What team the vehicle is on. 255 is no team. 0-3 are red, blue, green, gold in that order.


Health

protected java.lang.Integer Health
How much health the vehicle has left. Ranges from 0 to x, depending on the vehicle type.


Armor

protected java.lang.Integer Armor
How much the vehicle has left. Note: This may be 0 all the time. Maybe the vehicles are not supporting armor.


Driver

protected UnrealId Driver
Unique Id of the driver - if any.


TeamLocked

protected boolean TeamLocked
If the vehicle is locked just for its current team.


Type

protected java.lang.String Type
Class of the vehicle. If it is a car, turret etc.

Constructor Detail

VehicleMessage

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


VehicleMessage

public VehicleMessage(UnrealId Id,
                      Rotation Rotation,
                      Location Location,
                      Velocity Velocity,
                      boolean Visible,
                      java.lang.Integer Team,
                      java.lang.Integer Health,
                      java.lang.Integer Armor,
                      UnrealId Driver,
                      boolean TeamLocked,
                      java.lang.String Type)
Creates new instance of the message Vehicle. 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. Corresponding GameBots message is VEH.

Parameters:
Id - Unique Id of the vehicle or vehicle part.
Rotation - Which direction the vehicle is facing in absolute terms.
Location - An absolute location of the vehicle within the map.
Velocity - Absolute velocity of the vehicle as a vector of movement per one game second.
Visible - If the vehicle is in the field of view of the bot.
Team - What team the vehicle is on. 255 is no team. 0-3 are red, blue, green, gold in that order.
Health - How much health the vehicle has left. Ranges from 0 to x, depending on the vehicle type.
Armor - How much the vehicle has left. Note: This may be 0 all the time. Maybe the vehicles are not supporting armor.
Driver - Unique Id of the driver - if any.
TeamLocked - If the vehicle is locked just for its current team.
Type - Class of the vehicle. If it is a car, turret etc.

VehicleMessage

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

Parameters:
original -
Method Detail

setTeamId

protected void setTeamId(ITeamId TeamId)
Used by Yylex to slip corretn TeamId.


getTeamId

public ITeamId getTeamId()

getId

public UnrealId getId()
Description copied from class: Vehicle
Unique Id of the vehicle or vehicle part.

Specified by:
getId in interface IWorldObjectUpdatedEvent
Specified by:
getId in interface IWorldObject
Specified by:
getId in class Vehicle
Returns:

getRotation

public Rotation getRotation()
Description copied from class: Vehicle
Which direction the vehicle is facing in absolute terms.

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

getLocation

public Location getLocation()
Description copied from class: Vehicle
An absolute location of the vehicle within the map.

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

getVelocity

public Velocity getVelocity()
Description copied from class: Vehicle
Absolute velocity of the vehicle as a vector of movement per one game second.

Specified by:
getVelocity in interface ILocomotive
Specified by:
getVelocity in class Vehicle
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 boolean isVisible()
Description copied from class: Vehicle
If the vehicle is in the field of view of the bot.

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

getTeam

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

Specified by:
getTeam in class Vehicle

getHealth

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

Specified by:
getHealth in class Vehicle

getArmor

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

Specified by:
getArmor in class Vehicle

getDriver

public UnrealId getDriver()
Description copied from class: Vehicle
Unique Id of the driver - if any.

Specified by:
getDriver in class Vehicle

isTeamLocked

public boolean isTeamLocked()
Description copied from class: Vehicle
If the vehicle is locked just for its current team.

Specified by:
isTeamLocked in class Vehicle

getType

public java.lang.String getType()
Description copied from class: Vehicle
Class of the vehicle. If it is a car, turret etc.

Specified by:
getType in class Vehicle

getLocal

public VehicleLocal getLocal()
Specified by:
getLocal in interface ICompositeWorldObject

getShared

public VehicleShared getShared()
Specified by:
getShared in interface ICompositeWorldObject

getStatic

public VehicleStatic getStatic()
Specified by:
getStatic in interface ICompositeWorldObject

update

public IWorldObjectUpdateResult<IWorldObject> update(IWorldObject object)
Specified by:
update in interface IWorldObjectUpdatedEvent

toString

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

toHtmlString

public java.lang.String toHtmlString()
Overrides:
toHtmlString in class Vehicle