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

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

public class BombInfoCompositeImpl
extends BombInfo

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

Complete message documentation: Synchronous message. BombInfo contains all info about the bomb in the BotBombingRun game mode. Is not sent in other game types.


Nested Class Summary
 
Nested classes/interfaces inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BombInfo
BombInfo.BombInfoUpdate, BombInfo.ObjectDisappeared
 
Field Summary
protected  BombInfoLocalImpl partLocal
           
protected  BombInfoStaticImpl partStatic
           
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BombInfo
PROTOTYPE, SimTime
 
Constructor Summary
BombInfoCompositeImpl()
          Parameter-less contructor for the message.
BombInfoCompositeImpl(BombInfoCompositeImpl original)
          Cloning constructor.
BombInfoCompositeImpl(BombInfoLocalImpl partLocal, BombInfoSharedImpl partShared, BombInfoStaticImpl partStatic)
          Composite-impl constructor.
 
Method Summary
 UnrealId getHolder()
          Id of player/bot holding the bomb.
 java.lang.Integer getHolderTeam()
          The team of the current holder (if any).
 UnrealId getId()
          An unique Id for this bomb, assigned by the game.
 BombInfoLocal getLocal()
           
 Location getLocation()
          An absolute location of the bomb (Sent if we can actually see the flag).
 BombInfoShared getShared()
           
 java.lang.String getState()
          Represents the state the bomb is in.
 BombInfoStatic getStatic()
           
 Velocity getVelocity()
          Current velocity of the bomb.
 boolean isReachable()
          True if the bot can run here directly, false otherwise.
 boolean isVisible()
          True if the bot can see the bomb.
 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.BombInfo
createDisappearEvent, getSimTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

partStatic

protected BombInfoStaticImpl partStatic

partLocal

protected BombInfoLocalImpl partLocal
Constructor Detail

BombInfoCompositeImpl

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


BombInfoCompositeImpl

public BombInfoCompositeImpl(BombInfoLocalImpl partLocal,
                             BombInfoSharedImpl partShared,
                             BombInfoStaticImpl 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

BombInfoCompositeImpl

public BombInfoCompositeImpl(BombInfoCompositeImpl original)
Cloning constructor.

Parameters:
original -
Method Detail

setSimTime

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

Overrides:
setSimTime in class BombInfo

getStatic

public BombInfoStatic getStatic()

getLocal

public BombInfoLocal getLocal()

getShared

public BombInfoShared getShared()

getId

public UnrealId getId()
Description copied from class: BombInfo
An unique Id for this bomb, assigned by the game.

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

getVelocity

public Velocity getVelocity()
Description copied from class: BombInfo
Current velocity of the bomb. TODO not sure if this actually does smthing

Specified by:
getVelocity in class BombInfo

getLocation

public Location getLocation()
Description copied from class: BombInfo
An absolute location of the bomb (Sent if we can actually see the flag).

Specified by:
getLocation in class BombInfo

getHolder

public UnrealId getHolder()
Description copied from class: BombInfo
Id of player/bot holding the bomb. (Sent if we can actually see the bomb and the bomb is being carried, or if the bomb is being carried by us).

Specified by:
getHolder in class BombInfo

getHolderTeam

public java.lang.Integer getHolderTeam()
Description copied from class: BombInfo
The team of the current holder (if any).

Specified by:
getHolderTeam in class BombInfo

isReachable

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

Specified by:
isReachable in class BombInfo

isVisible

public boolean isVisible()
Description copied from class: BombInfo
True if the bot can see the bomb.

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

getState

public java.lang.String getState()
Description copied from class: BombInfo
Represents the state the bomb is in. Can be "Held", "Dropped" or "Home".

Specified by:
getState in class BombInfo

toString

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

toHtmlString

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