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

Package class diagram package 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, cz.cuni.amis.utils.listener.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
 Integer getArmor()
          How much the vehicle has left.
 UnrealId getDriver()
          Unique Id of the driver - if any.
 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()
           
 Integer getTeam()
          What team the vehicle is on.
 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.
 String toHtmlString()
           
 String toString()
           
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Vehicle
createDisappearEvent, getSimTime, toJsonLiteral
 
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

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

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

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

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

getTeam

public 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 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 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 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 String toString()
Overrides:
toString in class Vehicle

toHtmlString

public String toHtmlString()
Overrides:
toHtmlString in class Vehicle


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