cz.cuni.amis.pogamut.udk.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.udk.communication.messages.GBObjectUpdate
          extended by cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.Vehicle
All Implemented Interfaces:
IWorldChangeEvent, IWorldObjectUpdatedEvent, IWorldObject, ILocated, ILocomotive, IRotable, IViewable, ICompositeWorldObject, IGBViewable, IGBWorldObjectEvent, cz.cuni.amis.utils.listener.Event

public class Vehicle
extends GBObjectUpdate
implements IGBWorldObjectEvent, IWorldObject, ILocated, ILocomotive, IRotable, IGBViewable

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 alpha testing right now. Corresponding GameBots message is VEH.


Nested Class Summary
static class Vehicle.ObjectDisappeared
          Used to drop Visible flag from the object.
 
Nested classes/interfaces inherited from interface cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdatedEvent
IWorldObjectUpdatedEvent.DestroyWorldObject
 
Field Summary
protected  int Armor
          How much the vehicle has left.
protected  UnrealId Driver
          Unique Id of the driver - if any.
protected  int 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.
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  Rotation Rotation
          Which direction the vehicle is facing in absolute terms.
protected  int Team
          What team the vehicle is on.
protected  boolean TeamLocked
          If the vehicle is locked just for its current team.
protected  double Time
           
protected  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.
 
Constructor Summary
Vehicle()
          Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
Vehicle(UnrealId Id, Rotation Rotation, Location Location, Velocity Velocity, boolean Visible, int Team, int Health, int Armor, UnrealId Driver, boolean TeamLocked, String Type)
          Creates new instance of command Vehicle.
Vehicle(Vehicle original)
          Cloning constructor.
Vehicle(Vehicle Original, boolean Visible)
          Used to create event that drops the Visible flag of the item.
 
Method Summary
 IGBWorldObjectDisappeared createDisappearEvent()
          Creates an update event that has to update visibility to false.
 boolean equals(Object obj)
           
 int getArmor()
          How much the vehicle has left.
 UnrealId getDriver()
          Unique Id of the driver - if any.
 int getHealth()
          How much health the vehicle has left.
 UnrealId getId()
          Unique Id of the vehicle or vehicle part.
 double getLastSeenTime()
           
 ILocalWorldObject getLocal()
           
 Location getLocation()
          An absolute location of the vehicle within the map.
 IWorldObject getObject()
          Returns original object (if method update() has already been called, for bot-programmer that is always true as the original object is updated and then the event is propagated).
 Rotation getRotation()
          Which direction the vehicle is facing in absolute terms.
 ISharedWorldObject getShared()
           
 long getSimTime()
           
 IStaticWorldObject getStatic()
           
 int getTeam()
          What team the vehicle is on.
protected  double getTime()
           
 String getType()
          Class of the vehicle.
 Velocity getVelocity()
          Absolute velocity of the vehicle as a vector of movement per one game second.
 int hashCode()
           
 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 setTime(double time)
           
 String toHtmlString()
           
 String toString()
           
 IWorldObjectUpdateResult update(IWorldObject obj)
           
 
Methods inherited from class cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
toJsonLiteral
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTOTYPE

public static final String PROTOTYPE
Example how the message looks like - used during parser tests.

See Also:
Constant Field Values

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 int Team
What team the vehicle is on. 255 is no team. 0-3 are red, blue, green, gold in that order.


Health

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


Armor

protected int 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 String Type
Class of the vehicle. If it is a car, turret etc.


Time

protected double Time
Constructor Detail

Vehicle

public Vehicle(UnrealId Id,
               Rotation Rotation,
               Location Location,
               Velocity Velocity,
               boolean Visible,
               int Team,
               int Health,
               int Armor,
               UnrealId Driver,
               boolean TeamLocked,
               String Type)
Creates new instance of command 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 alpha testing right now. Corresponding GameBots message for this command is .

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.

Vehicle

public Vehicle(Vehicle original)
Cloning constructor.


Vehicle

public Vehicle()
Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).


Vehicle

public Vehicle(Vehicle Original,
               boolean Visible)
Used to create event that drops the Visible flag of the item.

Method Detail

getId

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

Specified by:
getId in interface IWorldObjectUpdatedEvent
Specified by:
getId in interface IWorldObject

getRotation

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

Specified by:
getRotation in interface IRotable

getLocation

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

Specified by:
getLocation in interface ILocated

getVelocity

public Velocity getVelocity()
Absolute velocity of the vehicle as a vector of movement per one game second.

Specified by:
getVelocity in interface ILocomotive

isVisible

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

Specified by:
isVisible in interface IViewable

getTeam

public int getTeam()
What team the vehicle is on. 255 is no team. 0-3 are red, blue, green, gold in that order.


getHealth

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


getArmor

public int getArmor()
How much the vehicle has left. Note: This may be 0 all the time. Maybe the vehicles are not supporting armor.


getDriver

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


isTeamLocked

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


getType

public String getType()
Class of the vehicle. If it is a car, turret etc.


getTime

protected double getTime()

setTime

protected void setTime(double time)

getLastSeenTime

public double getLastSeenTime()

getLocal

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

getShared

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

getStatic

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

getSimTime

public long getSimTime()
Specified by:
getSimTime in interface IWorldChangeEvent
Specified by:
getSimTime in interface IWorldObject

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

createDisappearEvent

public IGBWorldObjectDisappeared createDisappearEvent()
Description copied from interface: IGBViewable
Creates an update event that has to update visibility to false.

Specified by:
createDisappearEvent in interface IGBViewable
Returns:

update

public IWorldObjectUpdateResult update(IWorldObject obj)
Specified by:
update in interface IWorldObjectUpdatedEvent

getObject

public IWorldObject getObject()
Returns original object (if method update() has already been called, for bot-programmer that is always true as the original object is updated and then the event is propagated).


toString

public String toString()
Overrides:
toString in class InfoMessage

toHtmlString

public String toHtmlString()


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