cz.cuni.pogamut.MessageObjects
Class Self

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

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

Information about your bot's state.
FIXME: is reachable present? In documentation is not can be delta message

See Also:
Serialized Form

Field Summary
 double adrenaline
          Adrenaline - how much adrenaline the bot has.
 int altFiring
           
 int armor
          Armor - how much armor the bot is wearing.
 int currentAltAmmo
          Alternative Ammo - how many alternative ammo for the current weapon the bot has.
 int currentAmmo
          CurrentAmmo - How much ammo the bot has left for current weapon
 int health
          Health - how much health the bot has left.
 Triple location
          Location - an absolute location
 java.lang.String name
          Name - players human readable name
 boolean reachable
           
 Triple rotation
          Rotation - which direction the player is facing in absolute terms
 boolean shooting
          Shooting - wether the bot is shooting or not TODO: FIXME: IS NOT IMPLEMENTED YET BY GAMEBOTS (in this class diff(), update() are OK)
 int team
          Team - what team the player is on. 255 is no team. 0-3 are red, blue, green, gold in that order
 Triple velocity
          Velocity - absolute velocity in UT units
 java.lang.String weapon
          Weapon - weapon the player is holding.
 
Fields inherited from class cz.cuni.pogamut.MessageObjects.MessageObject
ID, type, types, UnrealID, visible
 
Constructor Summary
Self()
           
Self(int ID, java.lang.String UnrealID, java.lang.String name, Triple location, Triple rotation, Triple velocity, int team, java.lang.String weapon, boolean reachable, int health, int currentAmmo, int armor, boolean visible, boolean shooting, double adrenaline, int currentAltAmmo)
           
 
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.
 double getAdrenaline()
           
 int getArmor()
           
 int getCurrentAlternativeAmmo()
           
 int getCurrentAmmo()
           
 int getHealth()
           
 Triple getSelfLocation()
           
 java.lang.String getSelfName()
           
 boolean getSelfReachability()
           
 Triple getSelfRotation()
           
 int getSelfTeam()
           
 Triple getSelfVelocity()
           
 java.lang.String getSelfWeapon()
           
 boolean getShooting()
           
 boolean hasID()
           
 java.lang.String toString()
           
 void update(MessageObject newMsgObj)
          Writes non-null information from newMsgObj to current one.
 
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

name

public java.lang.String name
Name - players human readable name


location

public Triple location
Location - an absolute location


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. 255 is no team. 0-3 are red, blue, green, gold in that order


weapon

public java.lang.String weapon
Weapon - weapon the player is holding. Weapon strings to look for include: "ImpactHammer", "Enforcer", "Translocator", "GESBioRifle", "ShockRifle", "PulseGun", "Minigun2", "UT_FlakCannon", "UT_Eightball", "WarheadLauncher"


reachable

public boolean reachable

health

public int health
Health - how much health the bot has left. Starts at 100, ranges from 0 to 200


currentAmmo

public int currentAmmo
CurrentAmmo - How much ammo the bot has left for current weapon


armor

public int armor
Armor - how much armor the bot is wearing. Starts at 0, can range up to 200.


altFiring

public int altFiring

adrenaline

public double adrenaline
Adrenaline - how much adrenaline the bot has.


currentAltAmmo

public int currentAltAmmo
Alternative Ammo - how many alternative ammo for the current weapon the bot has.


shooting

public boolean shooting
Shooting - wether the bot is shooting or not TODO: FIXME: IS NOT IMPLEMENTED YET BY GAMEBOTS (in this class diff(), update() are OK)

Constructor Detail

Self

public Self(int ID,
            java.lang.String UnrealID,
            java.lang.String name,
            Triple location,
            Triple rotation,
            Triple velocity,
            int team,
            java.lang.String weapon,
            boolean reachable,
            int health,
            int currentAmmo,
            int armor,
            boolean visible,
            boolean shooting,
            double adrenaline,
            int currentAltAmmo)

Self

public Self()
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

getSelfLocation

public Triple getSelfLocation()

getSelfRotation

public Triple getSelfRotation()

getSelfVelocity

public Triple getSelfVelocity()

getSelfTeam

public int getSelfTeam()

getSelfWeapon

public java.lang.String getSelfWeapon()

getSelfReachability

public boolean getSelfReachability()

getArmor

public int getArmor()

getCurrentAmmo

public int getCurrentAmmo()

getHealth

public int getHealth()

getSelfName

public java.lang.String getSelfName()

getShooting

public boolean getShooting()

getCurrentAlternativeAmmo

public int getCurrentAlternativeAmmo()

getAdrenaline

public double getAdrenaline()

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

toString

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