cz.cuni.pogamut.MessageObjects
Class FlagInfo
java.lang.Object
cz.cuni.pogamut.MessageObjects.MessageObject
cz.cuni.pogamut.MessageObjects.FlagInfo
- All Implemented Interfaces:
- Located, Visible, java.io.Serializable, java.lang.Cloneable
public class FlagInfo
- extends MessageObject
- implements Located
FlagInfo contains all info about the flag in the CTF game mode
- id - a unique id for this flag, assigned by the game
- location - an absolute location of the flag
- holder - the identity of player/bot holding the flag (only sent if flag is being carried).
- team - the team whose flag this is
- reachable - true if the bot can run here directly, false otherwise
- state - whether the flag is "Held" "Droped" or "Home"
- See Also:
- Serialized Form
Constructor Summary |
FlagInfo()
|
FlagInfo(int ID,
java.lang.String UnrealID,
Triple location,
boolean reachable,
int team,
int holderID,
java.lang.String state,
boolean visible,
java.lang.String holderUnrealID)
|
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. |
Triple |
getLocation()
|
boolean |
hasID()
|
java.lang.String |
toString()
|
void |
update(MessageObject newMsgObj)
Writes non-null information from newMsgObj to current one. |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
location
public Triple location
holderID
public int holderID
holderUnrealID
public java.lang.String holderUnrealID
team
public int team
reachable
public boolean reachable
state
public java.lang.String state
FlagInfo
public FlagInfo()
FlagInfo
public FlagInfo(int ID,
java.lang.String UnrealID,
Triple location,
boolean reachable,
int team,
int holderID,
java.lang.String state,
boolean visible,
java.lang.String holderUnrealID)
hasID
public boolean hasID()
- Overrides:
hasID
in class MessageObject
toString
public java.lang.String toString()
- Overrides:
toString
in class MessageObject
clone
public java.lang.Object clone()
- Description copied from class:
MessageObject
- clone object - for hard copying
- Overrides:
clone
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
getLocation
public Triple getLocation()
- Specified by:
getLocation
in interface Located