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

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.MoverShared
          extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.MoverSharedImpl
All Implemented Interfaces:
IWorldObject, ILocated, ILocomotive, ISharedWorldObject, java.lang.Cloneable

public class MoverSharedImpl
extends MoverShared

Implementation of the shared part of the GameBots2004 message MOV.

Complete message documentation: Synchronous message. Movers can be doors, elevators, or any other chunk of architecture that can move. They generally need to be either run into, or activated by shooting or pressing a button. We are working on ways to provide bots with more of the information they need to deal with movers appropriately.


Nested Class Summary
static class MoverSharedImpl.MoverSharedUpdate
           
 
Field Summary
protected  UnrealId Id
          A unique Id of this mover assigned by the game.
protected  LocationProperty myLocation
          Location of the mover.
protected  StringProperty myState
          Name of the state Mover is currently in.
protected  VelocityProperty myVelocity
          Velocity vector.
protected  java.util.HashMap<PropertyId,ISharedProperty> propertyMap
           
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.MoverShared
LocationPropertyToken, SharedPropertyTokens, SimTime, StatePropertyToken, VelocityPropertyToken
 
Constructor Summary
MoverSharedImpl(MoverSharedImpl source)
           
MoverSharedImpl(WorldObjectId objectId, java.util.Collection<ISharedProperty> properties)
           
 
Method Summary
 MoverSharedImpl clone()
           
 UnrealId getId()
          A unique Id of this mover assigned by the game.
 Location getLocation()
          Location of the mover.
 java.util.Map<PropertyId,ISharedProperty> getProperties()
           
 ISharedProperty getProperty(PropertyId id)
           
 java.lang.String getState()
          Name of the state Mover is currently in.
 Velocity getVelocity()
          Velocity vector.
 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.MoverShared
getCompositeClass, getSimTime
 
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

Id

protected UnrealId Id
A unique Id of this mover assigned by the game.


myLocation

protected LocationProperty myLocation
Location of the mover.


myVelocity

protected VelocityProperty myVelocity
Velocity vector.


myState

protected StringProperty myState
Name of the state Mover is currently in. Can be used to determine the type of the mover.

Constructor Detail

MoverSharedImpl

public MoverSharedImpl(MoverSharedImpl source)

MoverSharedImpl

public MoverSharedImpl(WorldObjectId objectId,
                       java.util.Collection<ISharedProperty> properties)
Method Detail

setSimTime

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

Overrides:
setSimTime in class MoverShared

clone

public MoverSharedImpl clone()
Specified by:
clone in interface ISharedWorldObject
Specified by:
clone in class MoverShared

getProperty

public ISharedProperty getProperty(PropertyId id)

getProperties

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

getId

public UnrealId getId()
A unique Id of this mover assigned by the game.

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

getLocation

public Location getLocation()
Location of the mover.

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

getVelocity

public Velocity getVelocity()
Velocity vector.

Specified by:
getVelocity in interface ILocomotive
Specified by:
getVelocity in class MoverShared
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.

getState

public java.lang.String getState()
Name of the state Mover is currently in. Can be used to determine the type of the mover.

Specified by:
getState in class MoverShared

toString

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

toHtmlString

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