megamek.common
Class ArtilleryTracker

java.lang.Object
  extended by megamek.common.ArtilleryTracker
All Implemented Interfaces:
java.io.Serializable

public class ArtilleryTracker
extends java.lang.Object
implements java.io.Serializable

ArtilleryTracker--one held by every entity, it holds a list of the artillery weapons an entity controls, and the mods they get to hit certain hexes.

See Also:
Serialized Form

Constructor Summary
ArtilleryTracker()
          Creates new instance of the tracker
 
Method Summary
 void addWeapon(Mounted mounted)
          Adds new weapon
 int getModifier(Mounted weapon, Coords coords)
          Returns the modifier for the given weapon
protected  megamek.common.ArtilleryTracker.ArtilleryModifier getModifierByCoords(java.util.Vector<megamek.common.ArtilleryTracker.ArtilleryModifier> modifiers, Coords coords)
          Search the given vector of modifires for the modifier which coords equals to the given coords
protected  java.util.Vector<megamek.common.ArtilleryTracker.ArtilleryModifier> getWeaponModifiers(Mounted mounted)
          Returns the Vector of the modifiers for the given weapon
 void setModifier(Mounted weapon, int modifier, Coords coords)
          Sets the modifier for the given weapon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArtilleryTracker

public ArtilleryTracker()
Creates new instance of the tracker

Method Detail

addWeapon

public void addWeapon(Mounted mounted)
Adds new weapon

Parameters:
mounted - new weapon

setModifier

public void setModifier(Mounted weapon,
                        int modifier,
                        Coords coords)
Sets the modifier for the given weapon

Parameters:
weapon - weapon to set modifier for
modifier -
coords -

getModifier

public int getModifier(Mounted weapon,
                       Coords coords)
Returns the modifier for the given weapon

Parameters:
weapon - weapon to get modifier for
coords -
Returns:

getWeaponModifiers

protected java.util.Vector<megamek.common.ArtilleryTracker.ArtilleryModifier> getWeaponModifiers(Mounted mounted)
Returns the Vector of the modifiers for the given weapon

Parameters:
mounted - weapon to get modifiers for
Returns:
the Vector of the modifiers for the given weapon

getModifierByCoords

protected megamek.common.ArtilleryTracker.ArtilleryModifier getModifierByCoords(java.util.Vector<megamek.common.ArtilleryTracker.ArtilleryModifier> modifiers,
                                                                                Coords coords)
Search the given vector of modifires for the modifier which coords equals to the given coords

Parameters:
modifiers - Vector of the modifiers to process
coords - coordinates of the modifire looked for
Returns:
modifier with coords equals to the given on null if not found