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

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Mover
          extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.MoverCompositeImpl
All Implemented Interfaces:
IWorldChangeEvent, IWorldEvent, IWorldObject, ILocated, ILocomotive, IViewable, ICompositeWorldObject, IGBViewable, Event

public class MoverCompositeImpl
extends Mover

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

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
 
Nested classes/interfaces inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Mover
Mover.MoverUpdate, Mover.ObjectDisappeared
 
Field Summary
protected  MoverLocalImpl partLocal
           
protected  MoverStaticImpl partStatic
           
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Mover
PROTOTYPE, SimTime
 
Constructor Summary
MoverCompositeImpl()
          Parameter-less contructor for the message.
MoverCompositeImpl(MoverCompositeImpl original)
          Cloning constructor.
MoverCompositeImpl(MoverLocalImpl partLocal, MoverSharedImpl partShared, MoverStaticImpl partStatic)
          Composite-impl constructor.
 
Method Summary
 Location getBasePos()
          Base position of the mover.
 Location getBaseRot()
          Base rotation of the mover.
 double getDelayTime()
          Delay before starting to open (or before lift starts to move).
 UnrealId getId()
          A unique Id of this mover assigned by the game.
 MoverLocal getLocal()
           
 Location getLocation()
          Location of the mover.
 double getMoveTime()
          How long the mover moves, when it becomes triggered, before it stops.
 UnrealId getNavPointMarker()
          Navigation point marking this mover.
 double getOpenTime()
          How long the mover stands still when it reaches its destination position.
 MoverShared getShared()
           
 java.lang.String getState()
          Name of the state Mover is currently in.
 MoverStatic getStatic()
           
 java.lang.String getType()
          String class of the mover.
 Velocity getVelocity()
          Velocity vector.
 boolean isDamageTrig()
          True if the mover needs to be shot to be activated.
 boolean isIsMoving()
          Does the mover move right now?
 boolean isReachable()
          True if the bot can run here, false otherwise.
 boolean isVisible()
          If the mover 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.Mover
createDisappearEvent, getSimTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

partStatic

protected MoverStaticImpl partStatic

partLocal

protected MoverLocalImpl partLocal
Constructor Detail

MoverCompositeImpl

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


MoverCompositeImpl

public MoverCompositeImpl(MoverLocalImpl partLocal,
                          MoverSharedImpl partShared,
                          MoverStaticImpl 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

MoverCompositeImpl

public MoverCompositeImpl(MoverCompositeImpl original)
Cloning constructor.

Parameters:
original -
Method Detail

setSimTime

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

Overrides:
setSimTime in class Mover

getStatic

public MoverStatic getStatic()

getLocal

public MoverLocal getLocal()

getShared

public MoverShared getShared()

getId

public UnrealId getId()
Description copied from class: Mover
A unique Id of this mover assigned by the game.

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

getLocation

public Location getLocation()
Description copied from class: Mover
Location of the mover.

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

isVisible

public boolean isVisible()
Description copied from class: Mover
If the mover is in the field of view of the bot.

Specified by:
isVisible in interface IViewable
Specified by:
isVisible in class Mover
Returns:
True if the object is visible; false otherwise.

isReachable

public boolean isReachable()
Description copied from class: Mover
True if the bot can run here, false otherwise.

Specified by:
isReachable in class Mover

isDamageTrig

public boolean isDamageTrig()
Description copied from class: Mover
True if the mover needs to be shot to be activated.

Specified by:
isDamageTrig in class Mover

getType

public java.lang.String getType()
Description copied from class: Mover
String class of the mover.

Specified by:
getType in class Mover

isIsMoving

public boolean isIsMoving()
Description copied from class: Mover
Does the mover move right now?

Specified by:
isIsMoving in class Mover

getVelocity

public Velocity getVelocity()
Description copied from class: Mover
Velocity vector.

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

getMoveTime

public double getMoveTime()
Description copied from class: Mover
How long the mover moves, when it becomes triggered, before it stops.

Specified by:
getMoveTime in class Mover

getOpenTime

public double getOpenTime()
Description copied from class: Mover
How long the mover stands still when it reaches its destination position. After this time, the mover returns back to its initial position.

Specified by:
getOpenTime in class Mover

getBasePos

public Location getBasePos()
Description copied from class: Mover
Base position of the mover.

Specified by:
getBasePos in class Mover

getBaseRot

public Location getBaseRot()
Description copied from class: Mover
Base rotation of the mover.

Specified by:
getBaseRot in class Mover

getDelayTime

public double getDelayTime()
Description copied from class: Mover
Delay before starting to open (or before lift starts to move).

Specified by:
getDelayTime in class Mover

getState

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

Specified by:
getState in class Mover

getNavPointMarker

public UnrealId getNavPointMarker()
Description copied from class: Mover
Navigation point marking this mover. We can parse this Id to get information about type of the mover. Marker Id contains "lift" string if it is a lift, "door" string if it is a door, etc.

Specified by:
getNavPointMarker in class Mover

toString

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

toHtmlString

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