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

Package class diagram package 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, cz.cuni.amis.utils.listener.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 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  Integer getArmor()
          How much the vehicle has left.
abstract  UnrealId getDriver()
          Unique Id of the driver - if any.
abstract  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()
          Simulation time in MILLI SECONDS !!!
abstract  Integer getTeam()
          What team the vehicle is on.
abstract  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.
 String toHtmlString()
           
 String toJsonLiteral()
           
 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 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()
Simulation time in MILLI SECONDS !!!

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

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

getRotation

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

Specified by:
getRotation in interface IRotable

getLocation

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

Specified by:
getLocation in interface ILocated

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

isVisible

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

Specified by:
isVisible in interface IViewable

getTeam

public abstract 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 Integer getHealth()
How much health the vehicle has left. Ranges from 0 to x, depending on the vehicle type.


getArmor

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

toHtmlString

public String toHtmlString()

toJsonLiteral

public String toJsonLiteral()
Overrides:
toJsonLiteral in class InfoMessage


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