|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.base.communication.messages.InfoMessage cz.cuni.amis.pogamut.udk.communication.messages.GBObjectUpdate cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.FlagInfo
public class FlagInfo
Synchronous message. FlagInfo contains all info about the flag in the CTF game mode. Is not sent in other game types. Corresponding GameBots message is FLG.
Nested Class Summary | |
---|---|
static class |
FlagInfo.ObjectDisappeared
Used to drop Visible flag from the object. |
Nested classes/interfaces inherited from interface cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdatedEvent |
---|
IWorldObjectUpdatedEvent.DestroyWorldObject |
Field Summary | |
---|---|
protected UnrealId |
Holder
Id of player/bot holding the flag. |
protected UnrealId |
Id
An unique Id for this flag, assigned by the game. |
protected Location |
Location
An absolute location of the flag (Sent if we can actually see the flag). |
static String |
PROTOTYPE
Example how the message looks like - used during parser tests. |
protected boolean |
Reachable
True if the bot can run here directly, false otherwise. |
protected String |
State
Represents the state the flag is in. |
protected int |
Team
The owner team of this flag. |
protected double |
Time
|
protected boolean |
Visible
True if the bot can see the flag. |
Constructor Summary | |
---|---|
FlagInfo()
Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package). |
|
FlagInfo(FlagInfo original)
Cloning constructor. |
|
FlagInfo(FlagInfo Original,
boolean Visible)
Used to create event that drops the Visible flag of the item. |
|
FlagInfo(UnrealId Id,
Location Location,
UnrealId Holder,
int Team,
boolean Reachable,
boolean Visible,
String State)
Creates new instance of command FlagInfo. |
Method Summary | |
---|---|
IGBWorldObjectDisappeared |
createDisappearEvent()
Creates an update event that has to update visibility to false. |
boolean |
equals(Object obj)
|
UnrealId |
getHolder()
Id of player/bot holding the flag. |
UnrealId |
getId()
An unique Id for this flag, assigned by the game. |
double |
getLastSeenTime()
|
ILocalWorldObject |
getLocal()
|
Location |
getLocation()
An absolute location of the flag (Sent if we can actually see the flag). |
IWorldObject |
getObject()
Returns original object (if method update() has already been called, for bot-programmer that is always true as the original object is updated and then the event is propagated). |
ISharedWorldObject |
getShared()
|
long |
getSimTime()
|
String |
getState()
Represents the state the flag is in. |
IStaticWorldObject |
getStatic()
|
int |
getTeam()
The owner team of this flag. |
protected double |
getTime()
|
int |
hashCode()
|
boolean |
isReachable()
True if the bot can run here directly, false otherwise. |
boolean |
isVisible()
True if the bot can see the flag. |
protected void |
setTime(double time)
|
String |
toHtmlString()
|
String |
toString()
|
IWorldObjectUpdateResult |
update(IWorldObject obj)
|
Methods inherited from class cz.cuni.amis.pogamut.base.communication.messages.InfoMessage |
---|
toJsonLiteral |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String PROTOTYPE
protected UnrealId Id
protected Location Location
protected UnrealId Holder
protected int Team
protected boolean Reachable
protected boolean Visible
protected String State
protected double Time
Constructor Detail |
---|
public FlagInfo(UnrealId Id, Location Location, UnrealId Holder, int Team, boolean Reachable, boolean Visible, String State)
Id
- An unique Id for this flag, assigned by the game.Location
- An absolute location of the flag (Sent if we can actually
see the flag).Holder
- 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).Team
- The owner team of this flag.Reachable
- True if the bot can run here directly, false otherwise.Visible
- True if the bot can see the flag.State
- 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!).public FlagInfo(FlagInfo original)
public FlagInfo()
public FlagInfo(FlagInfo Original, boolean Visible)
Method Detail |
---|
public UnrealId getId()
getId
in interface IWorldObjectUpdatedEvent
getId
in interface IWorldObject
public Location getLocation()
getLocation
in interface ILocated
public UnrealId getHolder()
public int getTeam()
public boolean isReachable()
public boolean isVisible()
isVisible
in interface IViewable
public String getState()
protected double getTime()
protected void setTime(double time)
public double getLastSeenTime()
public ILocalWorldObject getLocal()
getLocal
in interface ICompositeWorldObject
public ISharedWorldObject getShared()
getShared
in interface ICompositeWorldObject
public IStaticWorldObject getStatic()
getStatic
in interface ICompositeWorldObject
public long getSimTime()
getSimTime
in interface IWorldChangeEvent
getSimTime
in interface IWorldObject
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public IGBWorldObjectDisappeared createDisappearEvent()
IGBViewable
createDisappearEvent
in interface IGBViewable
public IWorldObjectUpdateResult update(IWorldObject obj)
update
in interface IWorldObjectUpdatedEvent
public IWorldObject getObject()
public String toString()
toString
in class InfoMessage
public String toHtmlString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |