cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages
Class PlayerCompositeImpl

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player
          extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.PlayerCompositeImpl
All Implemented Interfaces:
IWorldChangeEvent, IWorldEvent, IWorldObject, ILocated, ILocomotive, IRotable, IViewable, ICompositeWorldObject, IPlayer, IPerson, IGBViewable, Event

public class PlayerCompositeImpl
extends Player

Composite implementation of the PLR abstract message. It wraps Local/Shared/Static parts in single object allowing to presenting a nice facade for users.

Complete message documentation: Synchronous message. Contains information about other players in the game, like their current velocity, position, weapon and reachability. Only reports those players that are visible. (within field of view and not occluded).


Nested Class Summary
 
Nested classes/interfaces inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player
Player.ObjectDisappeared, Player.PlayerUpdate
 
Field Summary
protected  PlayerLocalImpl partLocal
           
protected  PlayerStaticImpl partStatic
           
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player
PROTOTYPE, SimTime
 
Constructor Summary
PlayerCompositeImpl()
          Parameter-less contructor for the message.
PlayerCompositeImpl(PlayerCompositeImpl original)
          Cloning constructor.
PlayerCompositeImpl(PlayerLocalImpl partLocal, PlayerSharedImpl partShared, PlayerStaticImpl partStatic)
          Composite-impl constructor.
 
Method Summary
 java.lang.String getAction()
          Atomic action this bot is doing (BDI).
 int getFiring()
          0 means is not firing, 1 - firing in primary mode, 2 - firing in secondary mode (alt firing).
 UnrealId getId()
          Unique Id of the player.
 java.lang.String getJmx()
          Exported just for control server.
 PlayerLocal getLocal()
           
 Location getLocation()
          An absolute location of the player within the map.
 java.lang.String getName()
          Human readable name of the player.
 Rotation getRotation()
          Which direction the player is facing in absolute terms.
 PlayerShared getShared()
           
 PlayerStatic getStatic()
           
 int getTeam()
          What team the player is on.
 Velocity getVelocity()
          Absolute velocity of the player as a vector of movement per one game second.
 java.lang.String getWeapon()
          Class of the weapon the player is holding.
 boolean isReachable()
          True if the bot can run to this other player directly, false otherwise.
 boolean isVisible()
          If the player is in the field of view of the bot.
 void setSimTime(long SimTime)
          Used by Yylex to slip correct time of the object or programmatically.
 java.lang.String toHtmlString()
           
 java.lang.String toString()
           
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player
createDisappearEvent, getSimTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

partStatic

protected PlayerStaticImpl partStatic

partLocal

protected PlayerLocalImpl partLocal
Constructor Detail

PlayerCompositeImpl

public PlayerCompositeImpl()
Parameter-less contructor for the message.


PlayerCompositeImpl

public PlayerCompositeImpl(PlayerLocalImpl partLocal,
                           PlayerSharedImpl partShared,
                           PlayerStaticImpl partStatic)
Composite-impl constructor. It assembles the message from its three fragments - local/shared/static.

Parameters:
partLocal - local-part of the message
partShared - shared-part of the message
partStatic - static-part of the message

PlayerCompositeImpl

public PlayerCompositeImpl(PlayerCompositeImpl original)
Cloning constructor.

Parameters:
original -
Method Detail

setSimTime

public void setSimTime(long SimTime)
Description copied from class: Player
Used by Yylex to slip correct time of the object or programmatically.

Overrides:
setSimTime in class Player

getStatic

public PlayerStatic getStatic()

getLocal

public PlayerLocal getLocal()

getShared

public PlayerShared getShared()

getId

public UnrealId getId()
Description copied from class: Player
Unique Id of the player.

Specified by:
getId in interface IWorldObject
Specified by:
getId in interface IPlayer
Specified by:
getId in class Player

getJmx

public java.lang.String getJmx()
Description copied from class: Player
Exported just for control server. Holds jmx address we need to connect to when we want to debug our bot.

Specified by:
getJmx in class Player

getName

public java.lang.String getName()
Description copied from class: Player
Human readable name of the player.

Specified by:
getName in interface IPlayer
Specified by:
getName in interface IPerson
Specified by:
getName in class Player

getAction

public java.lang.String getAction()
Description copied from class: Player
Atomic action this bot is doing (BDI).

Specified by:
getAction in interface IPlayer
Specified by:
getAction in class Player

isVisible

public boolean isVisible()
Description copied from class: Player
If the player is in the field of view of the bot.

Specified by:
isVisible in interface IViewable
Specified by:
isVisible in interface IPlayer
Specified by:
isVisible in class Player
Returns:
True if the object is visible; false otherwise.

getRotation

public Rotation getRotation()
Description copied from class: Player
Which direction the player is facing in absolute terms.

Specified by:
getRotation in interface IRotable
Specified by:
getRotation in interface IPlayer
Specified by:
getRotation in class Player
Returns:
Current rotation of the object, represented as yaw, roll and pitch.

getLocation

public Location getLocation()
Description copied from class: Player
An absolute location of the player within the map.

Specified by:
getLocation in interface ILocated
Specified by:
getLocation in interface IPlayer
Specified by:
getLocation in class Player
Returns:
Current location of the object, represented as a point within the world's coordinates.

getVelocity

public Velocity getVelocity()
Description copied from class: Player
Absolute velocity of the player as a vector of movement per one game second.

Specified by:
getVelocity in interface ILocomotive
Specified by:
getVelocity in interface IPlayer
Specified by:
getVelocity in class Player
Returns:
Current direction in which the object is moving and absolute velocity of the object within the world. The direction is represented as a vector within the world's coordinates. The size of velocity is represented by length of that vector.

getTeam

public int getTeam()
Description copied from class: Player
What team the player is on. 255 is no team. 0-3 are red, blue, green, gold in that order.

Specified by:
getTeam in interface IPlayer
Specified by:
getTeam in class Player

getWeapon

public java.lang.String getWeapon()
Description copied from class: Player
Class of the weapon the player is holding. Weapon strings to look for include: "AssaultRifle", "ShieldGun", "FlakCannon", "BioRifle", "ShockRifle", "LinkGun", "SniperRifle", "RocketLauncher", "Minigun", "LightingGun", "Translocator". TODO: Look if this is all.

Specified by:
getWeapon in interface IPlayer
Specified by:
getWeapon in class Player

isReachable

public boolean isReachable()
Description copied from class: Player
True if the bot can run to this other player directly, false otherwise. Possible reasons for false: pit or obstacle between the two characters.

Specified by:
isReachable in interface IPlayer
Specified by:
isReachable in class Player

getFiring

public int getFiring()
Description copied from class: Player
0 means is not firing, 1 - firing in primary mode, 2 - firing in secondary mode (alt firing).

Specified by:
getFiring in interface IPlayer
Specified by:
getFiring in class Player

toString

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

toHtmlString

public java.lang.String toHtmlString()
Specified by:
toHtmlString in interface IPlayer
Overrides:
toHtmlString in class Player