cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages
Class PlayerDamaged

Package class diagram package PlayerDamaged
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.udk.communication.messages.GBEvent
          extended by cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.PlayerDamaged
All Implemented Interfaces:
IWorldChangeEvent, IWorldEventWrapper, IWorldEvent, IGBWorldEvent, cz.cuni.amis.utils.listener.Event

public class PlayerDamaged
extends GBEvent
implements IWorldEvent, IWorldChangeEvent

Asynchronous message. Bot hurt another player. Hit them with a shot. Corresponding GameBots message is HIT.


Field Summary
protected  boolean BulletHit
          If this damage was caused by bullet.
protected  int Damage
          Amount of damage done.
protected  String DamageType
          A string describing what kind of damage.
protected  boolean DirectDamage
          If the damage is direct.
protected  boolean Flaming
          If this damage is causing our bot to burn.
protected  UnrealId Id
          Unique Id of the player hit.
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  boolean VehicleHit
          If this damage was caused by vehicle running over.
protected  String WeaponName
          Name of the weapon that caused this damage.
 
Constructor Summary
PlayerDamaged()
          Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
PlayerDamaged(PlayerDamaged original)
          Cloning constructor.
PlayerDamaged(UnrealId Id, int Damage, String DamageType, String WeaponName, boolean Flaming, boolean DirectDamage, boolean BulletHit, boolean VehicleHit)
          Creates new instance of command PlayerDamaged.
 
Method Summary
 int getDamage()
          Amount of damage done.
 String getDamageType()
          A string describing what kind of damage.
 UnrealId getId()
          Unique Id of the player hit.
 long getSimTime()
           
 String getWeaponName()
          Name of the weapon that caused this damage.
 boolean isBulletHit()
          If this damage was caused by bullet.
 boolean isDirectDamage()
          If the damage is direct.
 boolean isFlaming()
          If this damage is causing our bot to burn.
 boolean isVehicleHit()
          If this damage was caused by vehicle running over.
 String toHtmlString()
           
 String toString()
           
 
Methods inherited from class cz.cuni.amis.pogamut.udk.communication.messages.GBEvent
getWorldEvent
 
Methods inherited from class cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
toJsonLiteral
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTOTYPE

public static final String PROTOTYPE
Example how the message looks like - used during parser tests.

See Also:
Constant Field Values

Id

protected UnrealId Id
Unique Id of the player hit.


Damage

protected int Damage
Amount of damage done.


DamageType

protected String DamageType
A string describing what kind of damage.


WeaponName

protected String WeaponName
Name of the weapon that caused this damage.


Flaming

protected boolean Flaming
If this damage is causing our bot to burn. TODO


DirectDamage

protected boolean DirectDamage
If the damage is direct. TODO


BulletHit

protected boolean BulletHit
If this damage was caused by bullet.


VehicleHit

protected boolean VehicleHit
If this damage was caused by vehicle running over.

Constructor Detail

PlayerDamaged

public PlayerDamaged(UnrealId Id,
                     int Damage,
                     String DamageType,
                     String WeaponName,
                     boolean Flaming,
                     boolean DirectDamage,
                     boolean BulletHit,
                     boolean VehicleHit)
Creates new instance of command PlayerDamaged. Asynchronous message. Bot hurt another player. Hit them with a shot. Corresponding GameBots message for this command is .

Parameters:
Id - Unique Id of the player hit.
Damage - Amount of damage done.
DamageType - A string describing what kind of damage.
WeaponName - Name of the weapon that caused this damage.
Flaming - If this damage is causing our bot to burn. TODO
DirectDamage - If the damage is direct. TODO
BulletHit - If this damage was caused by bullet.
VehicleHit - If this damage was caused by vehicle running over.

PlayerDamaged

public PlayerDamaged(PlayerDamaged original)
Cloning constructor.


PlayerDamaged

public PlayerDamaged()
Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).

Method Detail

getId

public UnrealId getId()
Unique Id of the player hit.


getDamage

public int getDamage()
Amount of damage done.


getDamageType

public String getDamageType()
A string describing what kind of damage.


getWeaponName

public String getWeaponName()
Name of the weapon that caused this damage.


isFlaming

public boolean isFlaming()
If this damage is causing our bot to burn. TODO


isDirectDamage

public boolean isDirectDamage()
If the damage is direct. TODO


isBulletHit

public boolean isBulletHit()
If this damage was caused by bullet.


isVehicleHit

public boolean isVehicleHit()
If this damage was caused by vehicle running over.


getSimTime

public long getSimTime()
Specified by:
getSimTime in interface IWorldChangeEvent
Specified by:
getSimTime in interface IWorldEvent
Overrides:
getSimTime in class GBEvent

toString

public String toString()
Overrides:
toString in class InfoMessage

toHtmlString

public String toHtmlString()


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