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

Package class diagram package 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:
cz.cuni.amis.pogamut.base.communication.translator.event.IWorldChangeEvent, cz.cuni.amis.pogamut.base.communication.worldview.event.IWorldEvent, cz.cuni.amis.pogamut.base.communication.worldview.object.IWorldObject, cz.cuni.amis.pogamut.base3d.worldview.object.ILocated, cz.cuni.amis.pogamut.base3d.worldview.object.ILocomotive, cz.cuni.amis.pogamut.base3d.worldview.object.IRotable, cz.cuni.amis.pogamut.base3d.worldview.object.IViewable, cz.cuni.amis.pogamut.multi.communication.worldview.object.ICompositeWorldObject, cz.cuni.amis.pogamut.unreal.communication.messages.gbinfomessages.IPlayer, IPerson, IGBViewable, cz.cuni.amis.utils.listener.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
 String getAction()
          Atomic action this bot is doing (BDI).
 String getAnim()
          For UE2.
 String getBubble()
          For UE2.
 String getEmotCenter()
          For UE2.
 String getEmotLeft()
          For UE2.
 String getEmotRight()
          For UE2.
 int getFiring()
          0 means is not firing, 1 - firing in primary mode, 2 - firing in secondary mode (alt firing).
 cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId getId()
          Unique Id of the player.
 String getJmx()
          Exported just for control server.
 PlayerLocal getLocal()
           
 cz.cuni.amis.pogamut.base3d.worldview.object.Location getLocation()
          An absolute location of the player within the map.
 String getName()
          Human readable name of the player.
 cz.cuni.amis.pogamut.base3d.worldview.object.Rotation getRotation()
          Which direction the player is facing in absolute terms.
 PlayerShared getShared()
           
 PlayerStatic getStatic()
           
 int getTeam()
          What team the player is on.
 cz.cuni.amis.pogamut.base3d.worldview.object.Velocity getVelocity()
          Absolute velocity of the player as a vector of movement per one game second.
 String getWeapon()
          Class of the weapon the player is holding.
 boolean isCrouched()
          True if the bot is crouched.
 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.
 String toHtmlString()
           
 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 cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId getId()
Description copied from class: Player
Unique Id of the player.

Specified by:
getId in interface cz.cuni.amis.pogamut.base.communication.worldview.object.IWorldObject
Specified by:
getId in interface cz.cuni.amis.pogamut.unreal.communication.messages.gbinfomessages.IPlayer
Specified by:
getId in class Player

getJmx

public 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 String getName()
Description copied from class: Player
Human readable name of the player.

Specified by:
getName in interface cz.cuni.amis.pogamut.unreal.communication.messages.gbinfomessages.IPlayer
Specified by:
getName in interface IPerson
Specified by:
getName in class Player

getAction

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

Specified by:
getAction in interface cz.cuni.amis.pogamut.unreal.communication.messages.gbinfomessages.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 cz.cuni.amis.pogamut.base3d.worldview.object.IViewable
Specified by:
isVisible in interface cz.cuni.amis.pogamut.unreal.communication.messages.gbinfomessages.IPlayer
Specified by:
isVisible in class Player

getRotation

public cz.cuni.amis.pogamut.base3d.worldview.object.Rotation getRotation()
Description copied from class: Player
Which direction the player is facing in absolute terms.

Specified by:
getRotation in interface cz.cuni.amis.pogamut.base3d.worldview.object.IRotable
Specified by:
getRotation in interface cz.cuni.amis.pogamut.unreal.communication.messages.gbinfomessages.IPlayer
Specified by:
getRotation in class Player

getLocation

public cz.cuni.amis.pogamut.base3d.worldview.object.Location getLocation()
Description copied from class: Player
An absolute location of the player within the map.

Specified by:
getLocation in interface cz.cuni.amis.pogamut.base3d.worldview.object.ILocated
Specified by:
getLocation in interface cz.cuni.amis.pogamut.unreal.communication.messages.gbinfomessages.IPlayer
Specified by:
getLocation in class Player

getVelocity

public cz.cuni.amis.pogamut.base3d.worldview.object.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 cz.cuni.amis.pogamut.base3d.worldview.object.ILocomotive
Specified by:
getVelocity in interface cz.cuni.amis.pogamut.unreal.communication.messages.gbinfomessages.IPlayer
Specified by:
getVelocity in class Player

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 cz.cuni.amis.pogamut.unreal.communication.messages.gbinfomessages.IPlayer
Specified by:
getTeam in class Player

getWeapon

public 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 cz.cuni.amis.pogamut.unreal.communication.messages.gbinfomessages.IPlayer
Specified by:
getWeapon in class Player

isCrouched

public boolean isCrouched()
Description copied from class: Player
True if the bot is crouched.

Specified by:
isCrouched 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 cz.cuni.amis.pogamut.unreal.communication.messages.gbinfomessages.IPlayer
Specified by:
getFiring in class Player

getEmotLeft

public String getEmotLeft()
Description copied from class: Player
For UE2. Holds left emoticon of the bot, "None" means none set.

Specified by:
getEmotLeft in class Player

getEmotCenter

public String getEmotCenter()
Description copied from class: Player
For UE2. Holds center emoticon of the bot, "None" means none set.

Specified by:
getEmotCenter in class Player

getEmotRight

public String getEmotRight()
Description copied from class: Player
For UE2. Holds right emoticon of the bot, "None" means none set.

Specified by:
getEmotRight in class Player

getBubble

public String getBubble()
Description copied from class: Player
For UE2. Holds the bubble of the emoticon of the bot, "None" means none set.

Specified by:
getBubble in class Player

getAnim

public String getAnim()
Description copied from class: Player
For UE2. Current played animation of the bot.

Specified by:
getAnim in class Player

toString

public String toString()
Overrides:
toString in class Player

toHtmlString

public String toHtmlString()
Specified by:
toHtmlString in interface cz.cuni.amis.pogamut.unreal.communication.messages.gbinfomessages.IPlayer
Overrides:
toHtmlString in class Player


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