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

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.VehicleShared
          extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.VehicleMessage.VehicleSharedMessage
All Implemented Interfaces:
IWorldObject, ILocated, ILocomotive, IRotable, ISharedWorldObject, java.lang.Cloneable
Enclosing class:
VehicleMessage

public class VehicleMessage.VehicleSharedMessage
extends VehicleShared

Implementation of the shared part of the GameBots2004 message VEH, used to facade VEHMessage.

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.


Field Summary
protected  IntegerProperty myArmor
          How much the vehicle has left.
protected  UnrealIdProperty myDriver
          Unique Id of the driver - if any.
protected  IntegerProperty myHealth
          How much health the vehicle has left.
protected  LocationProperty myLocation
          An absolute location of the vehicle within the map.
protected  RotationProperty myRotation
          Which direction the vehicle is facing in absolute terms.
protected  IntegerProperty myTeam
          What team the vehicle is on.
protected  BooleanProperty myTeamLocked
          If the vehicle is locked just for its current team.
protected  VelocityProperty myVelocity
          Absolute velocity of the vehicle as a vector of movement per one game second.
protected  java.util.HashMap<PropertyId,ISharedProperty> propertyMap
           
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.VehicleShared
ArmorPropertyToken, DriverPropertyToken, HealthPropertyToken, LocationPropertyToken, RotationPropertyToken, SharedPropertyTokens, SimTime, TeamLockedPropertyToken, TeamPropertyToken, VelocityPropertyToken
 
Constructor Summary
VehicleMessage.VehicleSharedMessage()
           
 
Method Summary
 VehicleMessage.VehicleSharedMessage clone()
           
 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.
 Location getLocation()
          An absolute location of the vehicle within the map.
 java.util.Map<PropertyId,ISharedProperty> getProperties()
           
 ISharedProperty getProperty(PropertyId id)
           
 Rotation getRotation()
          Which direction the vehicle is facing in absolute terms.
 java.lang.Integer getTeam()
          What team the vehicle is on.
 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.
 java.lang.String toHtmlString()
           
 java.lang.String toString()
           
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.VehicleShared
getCompositeClass, getSimTime, setSimTime
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

propertyMap

protected java.util.HashMap<PropertyId,ISharedProperty> propertyMap

myRotation

protected RotationProperty myRotation
Which direction the vehicle is facing in absolute terms.


myLocation

protected LocationProperty myLocation
An absolute location of the vehicle within the map.


myVelocity

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


myTeam

protected IntegerProperty myTeam
What team the vehicle is on. 255 is no team. 0-3 are red, blue, green, gold in that order.


myHealth

protected IntegerProperty myHealth
How much health the vehicle has left. Ranges from 0 to x, depending on the vehicle type.


myArmor

protected IntegerProperty myArmor
How much the vehicle has left. Note: This may be 0 all the time. Maybe the vehicles are not supporting armor.


myDriver

protected UnrealIdProperty myDriver
Unique Id of the driver - if any.


myTeamLocked

protected BooleanProperty myTeamLocked
If the vehicle is locked just for its current team.

Constructor Detail

VehicleMessage.VehicleSharedMessage

public VehicleMessage.VehicleSharedMessage()
Method Detail

clone

public VehicleMessage.VehicleSharedMessage clone()
Specified by:
clone in interface ISharedWorldObject
Specified by:
clone in class VehicleShared

getProperty

public ISharedProperty getProperty(PropertyId id)

getProperties

public java.util.Map<PropertyId,ISharedProperty> getProperties()

getId

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

Specified by:
getId in interface IWorldObject
Specified by:
getId in class VehicleShared
Returns:

getRotation

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

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

getLocation

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

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

getVelocity

public Velocity getVelocity()
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 VehicleShared
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.

getTeam

public java.lang.Integer getTeam()
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 VehicleShared

getHealth

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

Specified by:
getHealth in class VehicleShared

getArmor

public 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.

Specified by:
getArmor in class VehicleShared

getDriver

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

Specified by:
getDriver in class VehicleShared

isTeamLocked

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

Specified by:
isTeamLocked in class VehicleShared

toString

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

toHtmlString

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