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

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

public class FlagInfoSharedImpl
extends FlagInfoShared

Implementation of the shared part of the GameBots2004 message FLG.

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
static class FlagInfoSharedImpl.FlagInfoSharedUpdate
           
 
Field Summary
protected  UnrealId Id
          An unique Id for this flag, assigned by the game.
protected  UnrealIdProperty myHolder
          Id of player/bot holding the flag.
protected  LocationProperty myLocation
          An absolute location of the flag (Sent if we can actually see the flag).
protected  StringProperty myState
          Represents the state the flag is in.
protected  IntegerProperty myTeam
          The owner team of this flag.
protected  java.util.HashMap<PropertyId,ISharedProperty> propertyMap
           
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.FlagInfoShared
HolderPropertyToken, LocationPropertyToken, SharedPropertyTokens, SimTime, StatePropertyToken, TeamPropertyToken
 
Constructor Summary
FlagInfoSharedImpl(FlagInfoSharedImpl source)
           
FlagInfoSharedImpl(WorldObjectId objectId, java.util.Collection<ISharedProperty> properties)
           
 
Method Summary
 FlagInfoSharedImpl clone()
           
 UnrealId getHolder()
          Id of player/bot holding the flag.
 UnrealId getId()
          An unique Id for this flag, assigned by the game.
 Location getLocation()
          An absolute location of the flag (Sent if we can actually see the flag).
 java.util.Map<PropertyId,ISharedProperty> getProperties()
           
 ISharedProperty getProperty(PropertyId id)
           
 java.lang.String getState()
          Represents the state the flag is in.
 java.lang.Integer getTeam()
          The owner team of this 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.FlagInfoShared
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
An unique Id for this flag, assigned by the game.


myLocation

protected LocationProperty myLocation
An absolute location of the flag (Sent if we can actually see the flag).


myHolder

protected UnrealIdProperty myHolder
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).


myTeam

protected IntegerProperty myTeam
The owner team of this flag.


myState

protected StringProperty myState
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!).

Constructor Detail

FlagInfoSharedImpl

public FlagInfoSharedImpl(FlagInfoSharedImpl source)

FlagInfoSharedImpl

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

setSimTime

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

Overrides:
setSimTime in class FlagInfoShared

clone

public FlagInfoSharedImpl clone()
Specified by:
clone in interface ISharedWorldObject
Specified by:
clone in class FlagInfoShared

getProperty

public ISharedProperty getProperty(PropertyId id)

getProperties

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

getId

public UnrealId getId()
An unique Id for this flag, assigned by the game.

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

getLocation

public Location getLocation()
An absolute location of the flag (Sent if we can actually see the flag).

Specified by:
getLocation in class FlagInfoShared

getHolder

public UnrealId getHolder()
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 FlagInfoShared

getTeam

public java.lang.Integer getTeam()
The owner team of this flag.

Specified by:
getTeam in class FlagInfoShared

getState

public java.lang.String getState()
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 FlagInfoShared

toString

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

toHtmlString

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