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

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.VehicleCompositeImpl
All Implemented Interfaces:
IWorldChangeEvent, IWorldEvent, IWorldObject, ILocated, ILocomotive, IRotable, IViewable, ICompositeWorldObject, IGBViewable, Event

public class VehicleCompositeImpl
extends Vehicle

Composite implementation of the VEH abstract message. It wraps Local/Shared/Static parts in single object allowing to presenting a nice facade for users.

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
 
Nested classes/interfaces inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Vehicle
Vehicle.ObjectDisappeared, Vehicle.VehicleUpdate
 
Field Summary
protected  VehicleLocalImpl partLocal
           
protected  VehicleStaticImpl partStatic
           
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Vehicle
PROTOTYPE, SimTime
 
Constructor Summary
VehicleCompositeImpl()
          Parameter-less contructor for the message.
VehicleCompositeImpl(VehicleCompositeImpl original)
          Cloning constructor.
VehicleCompositeImpl(VehicleLocalImpl partLocal, VehicleSharedImpl partShared, VehicleStaticImpl partStatic)
          Composite-impl constructor.
 
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.
 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.
 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 cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Vehicle
createDisappearEvent, getSimTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

partStatic

protected VehicleStaticImpl partStatic

partLocal

protected VehicleLocalImpl partLocal
Constructor Detail

VehicleCompositeImpl

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


VehicleCompositeImpl

public VehicleCompositeImpl(VehicleLocalImpl partLocal,
                            VehicleSharedImpl partShared,
                            VehicleStaticImpl partStatic)
Composite-impl constructor. It assembles the message from its three fragments - local/shared/static.

Parameters:
partLocal - local-part of the message
partShared - shared-part of the message
partStatic - static-part of the message

VehicleCompositeImpl

public VehicleCompositeImpl(VehicleCompositeImpl original)
Cloning constructor.

Parameters:
original -
Method Detail

setSimTime

public void setSimTime(long SimTime)
Description copied from class: Vehicle
Used by Yylex to slip correct time of the object or programmatically.

Overrides:
setSimTime in class Vehicle

getStatic

public VehicleStatic getStatic()

getLocal

public VehicleLocal getLocal()

getShared

public VehicleShared getShared()

getId

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

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

toString

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

toHtmlString

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