cz.cuni.pogamut.MessageObjects
Class NavPoint

java.lang.Object
  extended by cz.cuni.pogamut.MessageObjects.MessageObject
      extended by cz.cuni.pogamut.MessageObjects.NavPoint
All Implemented Interfaces:
Located, Visible, java.io.Serializable, java.lang.Cloneable

public class NavPoint
extends MessageObject
implements java.lang.Cloneable, java.io.Serializable, Located

NavPoint carries information about Unreal NavPoint - location, reachability, its neighbours and in case it is respawn point, class of item that respawn.
It is one of compressed messages, so it implements diff and update Can be delta message

See Also:
Serialized Form

Field Summary
 java.lang.String classOfPreferedWeapon
          prefered weapon to use at the spot - like XWeapons.ClassicSniperRifle on the snipingSpot
 java.lang.String flag
          could be PathNode, PlayerStart, InventorySpot, AIMarker.
private  int hashCode
          hash code for astar
private  boolean hashComputed
          thanks to weird hashcode flag if hashcode has been specified
 Item item
          If there is an item spawned in the same location it's saved here.
 java.lang.String itemClass
          Class of respawn item, "None" if no item is respawning there TODO: NOT SUPPORTED RIGHT NOW
 int itemID
          id of item laying on the NavPoint, when 0, there is not any
 java.lang.String itemUnrealID
          unrelID of item laying on the NavPoint, when null, there is not any
 Triple location
          Location of navpoint
 java.util.ArrayList<NeighNav> neighbours
          List of neighbours
 java.util.Map<java.lang.Integer,NeighNav> neighboursMap
          Neighbours: int id of neighbour navpoint -> NeighNav leading to the navpoint id
 boolean reachable
          Is there no obstacle in way bot-navpoint = can bot run there directly?
 boolean roamingSpot
          roaming spot is a place to make an ambush
 Triple rotation
          rotation - which direction agent should face to on the roamingSpot, snipingSpot
 boolean snipingSpot
          sniping spot is a place to use a sniper rifle from;)
 
Fields inherited from class cz.cuni.pogamut.MessageObjects.MessageObject
ID, type, types, UnrealID, visible
 
Constructor Summary
NavPoint()
           
NavPoint(int ID, java.lang.String UnrealID, Triple location, boolean reachable, boolean visible, java.util.ArrayList<NeighNav> neighbours, java.util.Map<java.lang.Integer,NeighNav> neighboursMap, int hashCode, java.lang.String itemClass, Item item, int itemID, java.lang.String itemUnrealID, java.lang.String flag, Triple rotation, boolean snipingSpot, boolean roamingSpot, java.lang.String classOfPreferedWeapon)
          copy constructor...
NavPoint(NavPoint original)
           
 
Method Summary
 java.lang.Object clone()
          clone object - for hard copying
 boolean diff(MessageObject old)
          change this object that all properties that are same as old will be set to null or 0 or similar.
 java.lang.String getFlag()
           
private  int getHashCode()
           
 Triple getLocation()
           
 NeighNav getNeighNavToNavpoint(int neighbourNavPointId)
          Returns you an edge leading to the neighbourNavPointId (if there is one, otherwise returns null).
 java.lang.String getPreferedWeaponClass()
           
 Triple getRotation()
           
 int hashCode()
           
 boolean hasID()
           
 boolean hasNeighbour(int neighbourNavPointId)
          tells you whether this navpoint has as a neighbour another navpoint, meaning
 boolean isReachable()
           
 boolean isRoamingSpot()
           
 boolean isSnipingSpot()
           
 boolean isVisible()
           
 void setLocation(Triple newLocation)
           
 java.lang.String toString()
           
 void update(MessageObject newMsgObj)
          Writes non-null information from newMsgObj to current one.
 
Methods inherited from class cz.cuni.pogamut.MessageObjects.MessageObject
equals, getID, getType, getUnrealID, getVisibility, setID, setType, setUnrealID, setVisible
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

location

public Triple location
Location of navpoint


itemClass

public java.lang.String itemClass
Class of respawn item, "None" if no item is respawning there TODO: NOT SUPPORTED RIGHT NOW


neighbours

public java.util.ArrayList<NeighNav> neighbours
List of neighbours


neighboursMap

public java.util.Map<java.lang.Integer,NeighNav> neighboursMap
Neighbours: int id of neighbour navpoint -> NeighNav leading to the navpoint id


hashComputed

private boolean hashComputed
thanks to weird hashcode flag if hashcode has been specified


hashCode

private int hashCode
hash code for astar


reachable

public boolean reachable
Is there no obstacle in way bot-navpoint = can bot run there directly?


item

public Item item
If there is an item spawned in the same location it's saved here.


itemID

public int itemID
id of item laying on the NavPoint, when 0, there is not any


itemUnrealID

public java.lang.String itemUnrealID
unrelID of item laying on the NavPoint, when null, there is not any


flag

public java.lang.String flag
could be PathNode, PlayerStart, InventorySpot, AIMarker. If Flag is AIMarker, then additional attributes can be found: - rotation - roamingSpot - snipingSpot - preferedWeapon


rotation

public Triple rotation
rotation - which direction agent should face to on the roamingSpot, snipingSpot


roamingSpot

public boolean roamingSpot
roaming spot is a place to make an ambush


snipingSpot

public boolean snipingSpot
sniping spot is a place to use a sniper rifle from;)


classOfPreferedWeapon

public java.lang.String classOfPreferedWeapon
prefered weapon to use at the spot - like XWeapons.ClassicSniperRifle on the snipingSpot

Constructor Detail

NavPoint

public NavPoint(int ID,
                java.lang.String UnrealID,
                Triple location,
                boolean reachable,
                boolean visible,
                java.util.ArrayList<NeighNav> neighbours,
                java.util.Map<java.lang.Integer,NeighNav> neighboursMap,
                int hashCode,
                java.lang.String itemClass,
                Item item,
                int itemID,
                java.lang.String itemUnrealID,
                java.lang.String flag,
                Triple rotation,
                boolean snipingSpot,
                boolean roamingSpot,
                java.lang.String classOfPreferedWeapon)
copy constructor... Sickbags on standby


NavPoint

public NavPoint(NavPoint original)

NavPoint

public NavPoint()
Method Detail

hasNeighbour

public boolean hasNeighbour(int neighbourNavPointId)
tells you whether this navpoint has as a neighbour another navpoint, meaning

Parameters:
neighbourNavPointId -
Returns:

getNeighNavToNavpoint

public NeighNav getNeighNavToNavpoint(int neighbourNavPointId)
Returns you an edge leading to the neighbourNavPointId (if there is one, otherwise returns null).

Parameters:
neighbourNavPointId -
Returns:

hasID

public boolean hasID()
Overrides:
hasID in class MessageObject

getHashCode

private int getHashCode()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

clone

public java.lang.Object clone()
Description copied from class: MessageObject
clone object - for hard copying

Overrides:
clone in class MessageObject

getLocation

public Triple getLocation()
Specified by:
getLocation in interface Located

isSnipingSpot

public boolean isSnipingSpot()
Returns:
true if it is a sniping spot

isRoamingSpot

public boolean isRoamingSpot()
Returns:
true if it is a roaming spot

getPreferedWeaponClass

public java.lang.String getPreferedWeaponClass()
Returns:
class of the prefered weapon for the spot (sniping or roaming)

getFlag

public java.lang.String getFlag()
Returns:
flag - can be null or PathNode, PlayerStart, InventorySpot, AIMarker. If Flag is AIMarker, then there are additional attributes like snipingSpot etc.

getRotation

public Triple getRotation()
Returns:
rotation agent should be facing to on the sniping/roaming spot

setLocation

public void setLocation(Triple newLocation)

isReachable

public boolean isReachable()

isVisible

public boolean isVisible()
Overrides:
isVisible in class MessageObject

diff

public boolean diff(MessageObject old)
Description copied from class: MessageObject
change this object that all properties that are same as old will be set to null or 0 or similar. in case all properties are same as old, return false, else true.
If old differs from current, update old.

Overrides:
diff in class MessageObject
Parameters:
old - Object we use as reference for change.
Returns:
true if the objects are not different

update

public void update(MessageObject newMsgObj)
Description copied from class: MessageObject
Writes non-null information from newMsgObj to current one. Remember that you have to overide this method if you creates a new descendant, so the Parser and Client can work correctly.

Overrides:
update in class MessageObject

toString

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