cz.cuni.pogamut.MessageObjects
Class Player

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

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

Contains information about other players in the game, like their current velocity, position, weapon and rechablity
Another character (bot or human) in the game. Only reports those players that are visible. (within field of view and not occluded).
Can be delta message

See Also:
Serialized Form

Field Summary
 boolean autoTrace
          Autotrace feature enabled?
 boolean drawTraceLines
          draw trace line in UT GUI?
 boolean invulnerable
          Is bot invulnerable?
 Triple location
          Location - an absolute location for the player
 boolean manualSpawn
          is it necessary to spawn bot manually?
 java.lang.String name
          Name of the player
 boolean reachable
          Reachable - true if the bot can run to this other player directly, false otherwise.
 Triple rotation
          Rotation - which direction the player is facing in absolute terms
 int shooting
          Shooting - whether player is shooting
 boolean showDebug
          show debug for him?
 boolean showFocalPoint
          show where the bot look at
 boolean synchronousOff
          Disable all synchronous messages?
 int team
          Team - what team the player is on.
static int TEAM_BLUE
           
static int TEAM_RED
           
 Triple velocity
          Velocity - absolute velocity in UT units
 double visionTime
          vision time of bot
 java.lang.String weapon
          Weapon - what class of weapon the character is holding.
 
Fields inherited from class cz.cuni.pogamut.MessageObjects.MessageObject
ID, type, types, UnrealID, visible
 
Constructor Summary
Player()
           
Player(int ID, java.lang.String UnrealID, Triple location, Triple rotation, Triple velocity, int team, java.lang.String weapon, boolean reachable, boolean visible, java.lang.String name, boolean autoTrace, boolean invulnerable, boolean manualSpawn, double visionTime, boolean showDebug, boolean showFocalPoint, boolean drawTraceLines, boolean synchronousOff)
           
Player(Player original)
           
Player(PlayerJoinsGame fake)
          This is used as a fake constructor for IDE, where we need to know only some parameters from here...
Player(PlayerLeft fake)
          This is used as a fake constructor for IDE, where we need to know only some parameters from here...
Player(java.lang.String UnrealID, int ID)
          Another fake constructor for
 
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 getPlayerReachability()
           
 Triple getPlayerRotation()
           
 int getPlayerTeam()
           
 Triple getPlayerVelocity()
           
 java.lang.String getPlayerWeapon()
           
 boolean hasID()
           
 java.lang.String toString()
           
 void update(MessageObject newMsgObj)
          Writes non-null information from newMsgObj to current one.
 void updateConfigChange(ConfigChange change)
           
 
Methods inherited from class cz.cuni.pogamut.MessageObjects.MessageObject
equals, getID, getType, getUnrealID, getVisibility, isVisible, setID, setType, setUnrealID, setVisible
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TEAM_RED

public static final int TEAM_RED
See Also:
Constant Field Values

TEAM_BLUE

public static final int TEAM_BLUE
See Also:
Constant Field Values

location

public Triple location
Location - an absolute location for the player


rotation

public Triple rotation
Rotation - which direction the player is facing in absolute terms


velocity

public Triple velocity
Velocity - absolute velocity in UT units


team

public int team
Team - what team the player is on.


weapon

public java.lang.String weapon
Weapon - what class of weapon the character is holding.


reachable

public boolean reachable
Reachable - true if the bot can run to this other player directly, false otherwise. Possible reasons for false: pit or obstacle between the two characters


shooting

public int shooting
Shooting - whether player is shooting


name

public java.lang.String name
Name of the player


autoTrace

public boolean autoTrace
Autotrace feature enabled?


invulnerable

public boolean invulnerable
Is bot invulnerable?


manualSpawn

public boolean manualSpawn
is it necessary to spawn bot manually?


visionTime

public double visionTime
vision time of bot


showDebug

public boolean showDebug
show debug for him?


showFocalPoint

public boolean showFocalPoint
show where the bot look at


drawTraceLines

public boolean drawTraceLines
draw trace line in UT GUI?


synchronousOff

public boolean synchronousOff
Disable all synchronous messages?

Constructor Detail

Player

public Player(PlayerJoinsGame fake)
This is used as a fake constructor for IDE, where we need to know only some parameters from here...

Parameters:
fake -

Player

public Player(PlayerLeft fake)
This is used as a fake constructor for IDE, where we need to know only some parameters from here...

Parameters:
fake -

Player

public Player(java.lang.String UnrealID,
              int ID)
Another fake constructor for

Parameters:
UnrealID -
ID -

Player

public Player(int ID,
              java.lang.String UnrealID,
              Triple location,
              Triple rotation,
              Triple velocity,
              int team,
              java.lang.String weapon,
              boolean reachable,
              boolean visible,
              java.lang.String name,
              boolean autoTrace,
              boolean invulnerable,
              boolean manualSpawn,
              double visionTime,
              boolean showDebug,
              boolean showFocalPoint,
              boolean drawTraceLines,
              boolean synchronousOff)

Player

public Player()

Player

public Player(Player original)
Method Detail

hasID

public boolean hasID()
Overrides:
hasID in class MessageObject

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

getPlayerRotation

public Triple getPlayerRotation()

getPlayerVelocity

public Triple getPlayerVelocity()

getPlayerTeam

public int getPlayerTeam()

getPlayerWeapon

public java.lang.String getPlayerWeapon()

getPlayerReachability

public boolean getPlayerReachability()

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

updateConfigChange

public void updateConfigChange(ConfigChange change)

toString

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