cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages
Class NavPoint

Package class diagram package NavPoint
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.udk.communication.messages.GBObjectUpdate
          extended by cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.NavPoint
All Implemented Interfaces:
IWorldChangeEvent, IWorldObjectUpdatedEvent, IWorldObject, ILocated, ILocomotive, IViewable, ICompositeWorldObject, IGBViewable, IGBWorldObjectEvent, cz.cuni.amis.utils.listener.Event

public class NavPoint
extends GBObjectUpdate
implements IGBWorldObjectEvent, IWorldObject, ILocated, ILocomotive, IGBViewable

Synchronous message. NavPoint carries information about UT navigation point - location, reachability... Also some item can be respawned at this point. Or some additional information can be stored here (if it is an ambush point, or sniper point..). Corresponding GameBots message is NAV.


Nested Class Summary
static class NavPoint.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  boolean AIMarker
          If this point is an AI marker - marks an interesting spot in the environment.
protected  boolean Door
          If this point marks a door mover.
protected  boolean DoorOpened
          True if this NavPoint is a Door and door is opened.
protected  int FlagOfTeam
          If this is a CTF game, then this contains team number that owns the flag located at this NavPoint.
protected  UnrealId Id
          A unique Id of this navigation point assigned by the game.
protected  Map<UnrealId,NavPointNeighbourLink> IncomingEdges
          Maps edge-ORIGINATES_FROM-navpoint-UnrealId to neighbour link, those are incoming edges (those edges that originates in different navpoint and ends here, do not use this to ask whether you can get to navpoint of specific unreal id, use OutgoingEdges instead).
protected  boolean InvSpot
          If this is an inventory spot (item is respawned at this point).
protected  UnrealId Item
          Unique Id of the respawned item (the item respawns at this point).
protected  ItemType ItemClass
          Class of the item (e.g.
protected  Item ItemInstance
          If item should be present at this navpoint it's instance will be here.
protected  boolean ItemSpawned
          True if the item is spawned at the point.
protected  boolean JumpDest
          If this point marks a jump destination - some place that can be reached by some special jump.
protected  boolean JumpSpot
          If this point marks a jump spot (a special device that causes the bot to jump high or far).
protected  boolean LiftCenter
          If this point marks a lift center (used to mark center of a lift mover, note that this point will be always moved with the lift).
protected  boolean LiftExit
          If this point marks a lift exit (used to mark exit point of a lift mover).
protected  boolean LiftJumpExit
          Boolean.
protected  javax.vecmath.Vector3d LiftOffset
          Starting vector between MyLift location and LiftCenter location.
protected  Location Location
          Location of navigation point.
protected  UnrealId Mover
          If this NavPoint is marking some mover, the mover id will be here.
protected  boolean NoDoubleJump
          Boolean.
protected  Map<UnrealId,NavPointNeighbourLink> OutgoingEdges
          Maps edge-LEADING_TO-navpoint-UnrealId to neighbour link, those are outgoing edges (those edges that originates in this navpoint going to another one, those you may usually travel).
protected  boolean PlayerStart
          If this is a player start (players and/or bots are respawned at this point).
protected  String PreferedWeapon
          Class of the weapon that should be prefered when using this point for AIMarker specified action.
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  boolean RoamingSpot
          Some ambush point, where is good chance to intercept approaching opponents.
protected  Rotation Rotation
          If the type is AIMarker.
protected  boolean SnipingSpot
          Point good for sniping.
protected  int TeamNumber
          Will be sent if this is a player start.
protected  boolean Teleporter
          If this point marks a teleport.
protected  double Time
           
protected  Velocity Velocity
          Velocity of the navigation point (if the navigation point is currently moving).
protected  boolean Visible
          If the point is in the field of view of the bot.
 
Constructor Summary
NavPoint()
          Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
NavPoint(NavPoint original)
          Cloning constructor.
NavPoint(NavPoint Original, boolean Visible)
          Used to create event that drops the Visible flag of the item.
NavPoint(UnrealId Id, Location Location, Velocity Velocity, boolean Visible, UnrealId Item, ItemType ItemClass, boolean ItemSpawned, boolean DoorOpened, UnrealId Mover, javax.vecmath.Vector3d LiftOffset, boolean LiftJumpExit, boolean NoDoubleJump, boolean InvSpot, boolean PlayerStart, int TeamNumber, boolean Door, boolean LiftCenter, boolean LiftExit, boolean AIMarker, boolean JumpSpot, boolean JumpDest, boolean Teleporter, Rotation Rotation, boolean RoamingSpot, boolean SnipingSpot, Item ItemInstance, Map<UnrealId,NavPointNeighbourLink> OutgoingEdges, Map<UnrealId,NavPointNeighbourLink> IncomingEdges, String PreferedWeapon, int FlagOfTeam)
          Creates new instance of command NavPoint.
 
Method Summary
 IGBWorldObjectDisappeared createDisappearEvent()
          Creates an update event that has to update visibility to false.
 boolean equals(Object obj)
           
 int getFlagOfTeam()
          If this is a CTF game, then this contains team number that owns the flag located at this NavPoint.
 UnrealId getId()
          A unique Id of this navigation point assigned by the game.
 Map<UnrealId,NavPointNeighbourLink> getIncomingEdges()
          Maps edge-ORIGINATES_FROM-navpoint-UnrealId to neighbour link, those are incoming edges (those edges that originates in different navpoint and ends here, do not use this to ask whether you can get to navpoint of specific unreal id, use OutgoingEdges instead).
 UnrealId getItem()
          Unique Id of the respawned item (the item respawns at this point).
 ItemType getItemClass()
          Class of the item (e.g.
 Item getItemInstance()
          If item should be present at this navpoint it's instance will be here.
 double getLastSeenTime()
           
 javax.vecmath.Vector3d getLiftOffset()
          Starting vector between MyLift location and LiftCenter location.
 ILocalWorldObject getLocal()
           
 Location getLocation()
          Location of navigation point.
 UnrealId getMover()
          If this NavPoint is marking some mover, the mover id will be here.
 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).
 Map<UnrealId,NavPointNeighbourLink> getOutgoingEdges()
          Maps edge-LEADING_TO-navpoint-UnrealId to neighbour link, those are outgoing edges (those edges that originates in this navpoint going to another one, those you may usually travel).
 String getPreferedWeapon()
          Class of the weapon that should be prefered when using this point for AIMarker specified action.
 Rotation getRotation()
          If the type is AIMarker.
 ISharedWorldObject getShared()
           
 long getSimTime()
           
 IStaticWorldObject getStatic()
           
 int getTeamNumber()
          Will be sent if this is a player start.
protected  double getTime()
           
 Velocity getVelocity()
          Velocity of the navigation point (if the navigation point is currently moving).
 int hashCode()
           
 boolean isAIMarker()
          If this point is an AI marker - marks an interesting spot in the environment.
 boolean isDoor()
          If this point marks a door mover.
 boolean isDoorOpened()
          True if this NavPoint is a Door and door is opened.
 boolean isInvSpot()
          If this is an inventory spot (item is respawned at this point).
 boolean isItemSpawned()
          True if the item is spawned at the point.
 boolean isJumpDest()
          If this point marks a jump destination - some place that can be reached by some special jump.
 boolean isJumpSpot()
          If this point marks a jump spot (a special device that causes the bot to jump high or far).
 boolean isLiftCenter()
          If this point marks a lift center (used to mark center of a lift mover, note that this point will be always moved with the lift).
 boolean isLiftExit()
          If this point marks a lift exit (used to mark exit point of a lift mover).
 boolean isLiftJumpExit()
          Boolean.
 boolean isNoDoubleJump()
          Boolean.
 boolean isPlayerStart()
          If this is a player start (players and/or bots are respawned at this point).
 boolean isRoamingSpot()
          Some ambush point, where is good chance to intercept approaching opponents.
 boolean isSnipingSpot()
          Point good for sniping.
 boolean isTeleporter()
          If this point marks a teleport.
 boolean isVisible()
          If the point is in the field of view of the bot.
 void setItem(Item item)
          DO NOT USE THIS METHOD! Reserved for GaviaLib (Pogamut core)! It's used to set correct item instance into the NavPoint.
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

PROTOTYPE

public static final String PROTOTYPE
Example how the message looks like - used during parser tests.

See Also:
Constant Field Values

Id

protected UnrealId Id
A unique Id of this navigation point assigned by the game.


Location

protected Location Location
Location of navigation point.


Velocity

protected Velocity Velocity
Velocity of the navigation point (if the navigation point is currently moving). Not sent at the moment.


Visible

protected boolean Visible
If the point is in the field of view of the bot.


Item

protected UnrealId Item
Unique Id of the respawned item (the item respawns at this point). Not sent if point is not an inventory spot. Sent only in HandShake.


ItemClass

protected ItemType ItemClass
Class of the item (e.g. LinkGun.WeaponPickup). Not sent if point is not an inventory spot. Sent only in HandShake.


ItemSpawned

protected boolean ItemSpawned
True if the item is spawned at the point. Not sent if point is not an inventory spot.


DoorOpened

protected boolean DoorOpened
True if this NavPoint is a Door and door is opened. Not sent if point is not a door.


Mover

protected UnrealId Mover
If this NavPoint is marking some mover, the mover id will be here. Not sent if point is not a Door, a LiftCenter or a LiftExit. Sent only in HandShake.


LiftOffset

protected javax.vecmath.Vector3d LiftOffset
Starting vector between MyLift location and LiftCenter location. Not sent if point is not a LiftCenter. Sent only in HandShake.


LiftJumpExit

protected boolean LiftJumpExit
Boolean. If we can/should exit the lift by a jump when near the destination place. Not sent if point is not a LiftExit. Sent only in HandShake.


NoDoubleJump

protected boolean NoDoubleJump
Boolean. If we should or not use double jump when exiting lift with a jump. Not sent if point is not a LiftExit. Sent only in HandShake.


InvSpot

protected boolean InvSpot
If this is an inventory spot (item is respawned at this point).


PlayerStart

protected boolean PlayerStart
If this is a player start (players and/or bots are respawned at this point).


TeamNumber

protected int TeamNumber
Will be sent if this is a player start. In Team games (team deathmatch, capture the flag) holds information about which team respawns at this player start spot. In non-team games will return 0!


Door

protected boolean Door
If this point marks a door mover.


LiftCenter

protected boolean LiftCenter
If this point marks a lift center (used to mark center of a lift mover, note that this point will be always moved with the lift).


LiftExit

protected boolean LiftExit
If this point marks a lift exit (used to mark exit point of a lift mover).


AIMarker

protected boolean AIMarker
If this point is an AI marker - marks an interesting spot in the environment. May be ambush point or sniping spot, etc.


JumpSpot

protected boolean JumpSpot
If this point marks a jump spot (a special device that causes the bot to jump high or far).


JumpDest

protected boolean JumpDest
If this point marks a jump destination - some place that can be reached by some special jump.


Teleporter

protected boolean Teleporter
If this point marks a teleport.


Rotation

protected Rotation Rotation
If the type is AIMarker. The rotation the bot should be facing, when doing the action specified by AIMarker. Sent only in HandShake.


RoamingSpot

protected boolean RoamingSpot
Some ambush point, where is good chance to intercept approaching opponents. Sent only in HandShake.


SnipingSpot

protected boolean SnipingSpot
Point good for sniping. Sent only in HandShake.


ItemInstance

protected Item ItemInstance
If item should be present at this navpoint it's instance will be here.


OutgoingEdges

protected Map<UnrealId,NavPointNeighbourLink> OutgoingEdges
Maps edge-LEADING_TO-navpoint-UnrealId to neighbour link, those are outgoing edges (those edges that originates in this navpoint going to another one, those you may usually travel).


IncomingEdges

protected Map<UnrealId,NavPointNeighbourLink> IncomingEdges
Maps edge-ORIGINATES_FROM-navpoint-UnrealId to neighbour link, those are incoming edges (those edges that originates in different navpoint and ends here, do not use this to ask whether you can get to navpoint of specific unreal id, use OutgoingEdges instead).


PreferedWeapon

protected String PreferedWeapon
Class of the weapon that should be prefered when using this point for AIMarker specified action. Sent only in HandShake.


FlagOfTeam

protected int FlagOfTeam
If this is a CTF game, then this contains team number that owns the flag located at this NavPoint.


Time

protected double Time
Constructor Detail

NavPoint

public NavPoint(UnrealId Id,
                Location Location,
                Velocity Velocity,
                boolean Visible,
                UnrealId Item,
                ItemType ItemClass,
                boolean ItemSpawned,
                boolean DoorOpened,
                UnrealId Mover,
                javax.vecmath.Vector3d LiftOffset,
                boolean LiftJumpExit,
                boolean NoDoubleJump,
                boolean InvSpot,
                boolean PlayerStart,
                int TeamNumber,
                boolean Door,
                boolean LiftCenter,
                boolean LiftExit,
                boolean AIMarker,
                boolean JumpSpot,
                boolean JumpDest,
                boolean Teleporter,
                Rotation Rotation,
                boolean RoamingSpot,
                boolean SnipingSpot,
                Item ItemInstance,
                Map<UnrealId,NavPointNeighbourLink> OutgoingEdges,
                Map<UnrealId,NavPointNeighbourLink> IncomingEdges,
                String PreferedWeapon,
                int FlagOfTeam)
Creates new instance of command NavPoint. Synchronous message. NavPoint carries information about UT navigation point - location, reachability... Also some item can be respawned at this point. Or some additional information can be stored here (if it is an ambush point, or sniper point..). Corresponding GameBots message for this command is .

Parameters:
Id - A unique Id of this navigation point assigned by the game.
Location - Location of navigation point.
Velocity - Velocity of the navigation point (if the navigation point is currently moving). Not sent at the moment.
Visible - If the point is in the field of view of the bot.
Item - Unique Id of the respawned item (the item respawns at this point). Not sent if point is not an inventory spot. Sent only in HandShake.
ItemClass - Class of the item (e.g. LinkGun.WeaponPickup). Not sent if point is not an inventory spot. Sent only in HandShake.
ItemSpawned - True if the item is spawned at the point. Not sent if point is not an inventory spot.
DoorOpened - True if this NavPoint is a Door and door is opened. Not sent if point is not a door.
Mover - If this NavPoint is marking some mover, the mover id will be here. Not sent if point is not a Door, a LiftCenter or a LiftExit. Sent only in HandShake.
LiftOffset - Starting vector between MyLift location and LiftCenter location. Not sent if point is not a LiftCenter. Sent only in HandShake.
LiftJumpExit - Boolean. If we can/should exit the lift by a jump when near the destination place. Not sent if point is not a LiftExit. Sent only in HandShake.
NoDoubleJump - Boolean. If we should or not use double jump when exiting lift with a jump. Not sent if point is not a LiftExit. Sent only in HandShake.
InvSpot - If this is an inventory spot (item is respawned at this point).
PlayerStart - If this is a player start (players and/or bots are respawned at this point).
TeamNumber - Will be sent if this is a player start. In Team games (team deathmatch, capture the flag) holds information about which team respawns at this player start spot. In non-team games will return 0!
Door - If this point marks a door mover.
LiftCenter - If this point marks a lift center (used to mark center of a lift mover, note that this point will be always moved with the lift).
LiftExit - If this point marks a lift exit (used to mark exit point of a lift mover).
AIMarker - If this point is an AI marker - marks an interesting spot in the environment. May be ambush point or sniping spot, etc.
JumpSpot - If this point marks a jump spot (a special device that causes the bot to jump high or far).
JumpDest - If this point marks a jump destination - some place that can be reached by some special jump.
Teleporter - If this point marks a teleport.
Rotation - If the type is AIMarker. The rotation the bot should be facing, when doing the action specified by AIMarker. Sent only in HandShake.
RoamingSpot - Some ambush point, where is good chance to intercept approaching opponents. Sent only in HandShake.
SnipingSpot - Point good for sniping. Sent only in HandShake.
ItemInstance - If item should be present at this navpoint it's instance will be here.
OutgoingEdges - Maps edge-LEADING_TO-navpoint-UnrealId to neighbour link, those are outgoing edges (those edges that originates in this navpoint going to another one, those you may usually travel).
IncomingEdges - Maps edge-ORIGINATES_FROM-navpoint-UnrealId to neighbour link, those are incoming edges (those edges that originates in different navpoint and ends here, do not use this to ask whether you can get to navpoint of specific unreal id, use OutgoingEdges instead).
PreferedWeapon - Class of the weapon that should be prefered when using this point for AIMarker specified action. Sent only in HandShake.
FlagOfTeam - If this is a CTF game, then this contains team number that owns the flag located at this NavPoint.

NavPoint

public NavPoint(NavPoint original)
Cloning constructor.


NavPoint

public NavPoint()
Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).


NavPoint

public NavPoint(NavPoint Original,
                boolean Visible)
Used to create event that drops the Visible flag of the item.

Method Detail

getId

public UnrealId getId()
A unique Id of this navigation point assigned by the game.

Specified by:
getId in interface IWorldObjectUpdatedEvent
Specified by:
getId in interface IWorldObject

getLocation

public Location getLocation()
Location of navigation point.

Specified by:
getLocation in interface ILocated

getVelocity

public Velocity getVelocity()
Velocity of the navigation point (if the navigation point is currently moving). Not sent at the moment.

Specified by:
getVelocity in interface ILocomotive

isVisible

public boolean isVisible()
If the point is in the field of view of the bot.

Specified by:
isVisible in interface IViewable

getItem

public UnrealId getItem()
Unique Id of the respawned item (the item respawns at this point). Not sent if point is not an inventory spot. Sent only in HandShake.


getItemClass

public ItemType getItemClass()
Class of the item (e.g. LinkGun.WeaponPickup). Not sent if point is not an inventory spot. Sent only in HandShake.


isItemSpawned

public boolean isItemSpawned()
True if the item is spawned at the point. Not sent if point is not an inventory spot.


isDoorOpened

public boolean isDoorOpened()
True if this NavPoint is a Door and door is opened. Not sent if point is not a door.


getMover

public UnrealId getMover()
If this NavPoint is marking some mover, the mover id will be here. Not sent if point is not a Door, a LiftCenter or a LiftExit. Sent only in HandShake.


getLiftOffset

public javax.vecmath.Vector3d getLiftOffset()
Starting vector between MyLift location and LiftCenter location. Not sent if point is not a LiftCenter. Sent only in HandShake.


isLiftJumpExit

public boolean isLiftJumpExit()
Boolean. If we can/should exit the lift by a jump when near the destination place. Not sent if point is not a LiftExit. Sent only in HandShake.


isNoDoubleJump

public boolean isNoDoubleJump()
Boolean. If we should or not use double jump when exiting lift with a jump. Not sent if point is not a LiftExit. Sent only in HandShake.


isInvSpot

public boolean isInvSpot()
If this is an inventory spot (item is respawned at this point).


isPlayerStart

public boolean isPlayerStart()
If this is a player start (players and/or bots are respawned at this point).


getTeamNumber

public int getTeamNumber()
Will be sent if this is a player start. In Team games (team deathmatch, capture the flag) holds information about which team respawns at this player start spot. In non-team games will return 0!


isDoor

public boolean isDoor()
If this point marks a door mover.


isLiftCenter

public boolean isLiftCenter()
If this point marks a lift center (used to mark center of a lift mover, note that this point will be always moved with the lift).


isLiftExit

public boolean isLiftExit()
If this point marks a lift exit (used to mark exit point of a lift mover).


isAIMarker

public boolean isAIMarker()
If this point is an AI marker - marks an interesting spot in the environment. May be ambush point or sniping spot, etc.


isJumpSpot

public boolean isJumpSpot()
If this point marks a jump spot (a special device that causes the bot to jump high or far).


isJumpDest

public boolean isJumpDest()
If this point marks a jump destination - some place that can be reached by some special jump.


isTeleporter

public boolean isTeleporter()
If this point marks a teleport.


getRotation

public Rotation getRotation()
If the type is AIMarker. The rotation the bot should be facing, when doing the action specified by AIMarker. Sent only in HandShake.


isRoamingSpot

public boolean isRoamingSpot()
Some ambush point, where is good chance to intercept approaching opponents. Sent only in HandShake.


isSnipingSpot

public boolean isSnipingSpot()
Point good for sniping. Sent only in HandShake.


getItemInstance

public Item getItemInstance()
If item should be present at this navpoint it's instance will be here.


getOutgoingEdges

public Map<UnrealId,NavPointNeighbourLink> getOutgoingEdges()
Maps edge-LEADING_TO-navpoint-UnrealId to neighbour link, those are outgoing edges (those edges that originates in this navpoint going to another one, those you may usually travel).


getIncomingEdges

public Map<UnrealId,NavPointNeighbourLink> getIncomingEdges()
Maps edge-ORIGINATES_FROM-navpoint-UnrealId to neighbour link, those are incoming edges (those edges that originates in different navpoint and ends here, do not use this to ask whether you can get to navpoint of specific unreal id, use OutgoingEdges instead).


getPreferedWeapon

public String getPreferedWeapon()
Class of the weapon that should be prefered when using this point for AIMarker specified action. Sent only in HandShake.


getFlagOfTeam

public int getFlagOfTeam()
If this is a CTF game, then this contains team number that owns the flag located at this NavPoint.


getTime

protected double getTime()

setTime

protected void setTime(double time)

getLastSeenTime

public double getLastSeenTime()

getLocal

public ILocalWorldObject getLocal()
Specified by:
getLocal in interface ICompositeWorldObject

getShared

public ISharedWorldObject getShared()
Specified by:
getShared in interface ICompositeWorldObject

getStatic

public IStaticWorldObject getStatic()
Specified by:
getStatic in interface ICompositeWorldObject

getSimTime

public long getSimTime()
Specified by:
getSimTime in interface IWorldChangeEvent
Specified by:
getSimTime in interface IWorldObject

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

setItem

public void setItem(Item item)
DO NOT USE THIS METHOD! Reserved for GaviaLib (Pogamut core)! It's used to set correct item instance into the NavPoint.


createDisappearEvent

public IGBWorldObjectDisappeared createDisappearEvent()
Description copied from interface: IGBViewable
Creates an update event that has to update visibility to false.

Specified by:
createDisappearEvent in interface IGBViewable
Returns:

update

public IWorldObjectUpdateResult update(IWorldObject obj)
Specified by:
update in interface IWorldObjectUpdatedEvent

getObject

public 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).


toString

public String toString()
Overrides:
toString in class InfoMessage

toHtmlString

public String toHtmlString()


Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.