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

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

public class FlagInfoCompositeImpl
extends FlagInfo

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

Complete message documentation: Synchronous message. FlagInfo contains all info about the flag in the CTF 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.FlagInfo
FlagInfo.FlagInfoUpdate, FlagInfo.ObjectDisappeared
 
Field Summary
protected  FlagInfoLocalImpl partLocal
           
protected  FlagInfoStaticImpl partStatic
           
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.FlagInfo
PROTOTYPE, SimTime
 
Constructor Summary
FlagInfoCompositeImpl()
          Parameter-less contructor for the message.
FlagInfoCompositeImpl(FlagInfoCompositeImpl original)
          Cloning constructor.
FlagInfoCompositeImpl(FlagInfoLocalImpl partLocal, FlagInfoSharedImpl partShared, FlagInfoStaticImpl partStatic)
          Composite-impl constructor.
 
Method Summary
 UnrealId getHolder()
          Id of player/bot holding the flag.
 UnrealId getId()
          An unique Id for this flag, assigned by the game.
 FlagInfoLocal getLocal()
           
 Location getLocation()
          An absolute location of the flag (Sent if we can actually see the flag).
 FlagInfoShared getShared()
           
 java.lang.String getState()
          Represents the state the flag is in.
 FlagInfoStatic getStatic()
           
 java.lang.Integer getTeam()
          The owner team of this flag.
 boolean isReachable()
          True if the bot can run here directly, false otherwise.
 boolean isVisible()
          True if the bot can see the flag.
 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.FlagInfo
createDisappearEvent, getSimTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

partStatic

protected FlagInfoStaticImpl partStatic

partLocal

protected FlagInfoLocalImpl partLocal
Constructor Detail

FlagInfoCompositeImpl

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


FlagInfoCompositeImpl

public FlagInfoCompositeImpl(FlagInfoLocalImpl partLocal,
                             FlagInfoSharedImpl partShared,
                             FlagInfoStaticImpl 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

FlagInfoCompositeImpl

public FlagInfoCompositeImpl(FlagInfoCompositeImpl original)
Cloning constructor.

Parameters:
original -
Method Detail

setSimTime

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

Overrides:
setSimTime in class FlagInfo

getStatic

public FlagInfoStatic getStatic()

getLocal

public FlagInfoLocal getLocal()

getShared

public FlagInfoShared getShared()

getId

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

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

getLocation

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

Specified by:
getLocation in class FlagInfo

getHolder

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

Specified by:
getHolder in class FlagInfo

getTeam

public java.lang.Integer getTeam()
Description copied from class: FlagInfo
The owner team of this flag.

Specified by:
getTeam in class FlagInfo

isReachable

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

Specified by:
isReachable in class FlagInfo

isVisible

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

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

getState

public java.lang.String getState()
Description copied from class: FlagInfo
Represents the state the flag is in. Can be "Held", "Dropped" or "Home" (note that the first letter does not have to be in upper case!).

Specified by:
getState in class FlagInfo

toString

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

toHtmlString

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