rl.common.game.elements
Class Weapon

java.lang.Object
  extended by rl.common.game.elements.Equipment
      extended by rl.common.game.elements.Weapon
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AntiPersonnel, Artillery, GaussCannon, InfantryMortar, InfantryWeaponFire, Laser, MassDriverCannon, Missile, PointDefence, ThorJavelin, VehicleMissile

public abstract class Weapon
extends Equipment

See Also:
Serialized Form

Nested Class Summary
static class Weapon.WeaponType
           
 
Nested classes/interfaces inherited from class rl.common.game.elements.Equipment
Equipment.LocationRestriction, Equipment.Type, Equipment.Use
 
Field Summary
(package private) static long serialVersionUID
           
static java.lang.String[] WeaponTypeName
           
 
Constructor Summary
Weapon()
           
 
Method Summary
abstract  int getAmmunitionCapacity()
           
abstract  java.util.Vector<java.lang.String> getAmmunitionTypeNames()
           
abstract  WeaponDamageTemplate getDamageTemplate()
           
 int getInfantryDamage(int modifiedDieRoll)
          Returns the number of infantry casualties from this weapon
 int getRange()
           
 Equipment.Type getType()
           
abstract  Weapon.WeaponType getWeaponType()
           
abstract  boolean isArtilleryWeapon()
           
 boolean isBallistic()
           
abstract  boolean isDirectFireWeapon()
           
abstract  boolean isIndirectFireWeapon()
           
abstract  boolean isOffensiveWeapon()
           
 void setValue(org.jdom.Element val)
           
abstract  boolean usesAmmunition()
           
abstract  boolean usesAmmunitionTypes()
           
 
Methods inherited from class rl.common.game.elements.Equipment
getCost, getEquipmentUse, getMass, getName, getPower, getRestriction, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

WeaponTypeName

public static final java.lang.String[] WeaponTypeName
Constructor Detail

Weapon

public Weapon()
Method Detail

getRange

public int getRange()

isBallistic

public boolean isBallistic()

getType

public Equipment.Type getType()
Specified by:
getType in class Equipment

isOffensiveWeapon

public abstract boolean isOffensiveWeapon()

isDirectFireWeapon

public abstract boolean isDirectFireWeapon()

isIndirectFireWeapon

public abstract boolean isIndirectFireWeapon()

isArtilleryWeapon

public abstract boolean isArtilleryWeapon()

getWeaponType

public abstract Weapon.WeaponType getWeaponType()

getDamageTemplate

public abstract WeaponDamageTemplate getDamageTemplate()

usesAmmunitionTypes

public abstract boolean usesAmmunitionTypes()

getAmmunitionTypeNames

public abstract java.util.Vector<java.lang.String> getAmmunitionTypeNames()

usesAmmunition

public abstract boolean usesAmmunition()

getAmmunitionCapacity

public abstract int getAmmunitionCapacity()

setValue

public void setValue(org.jdom.Element val)
              throws java.lang.IllegalArgumentException
Overrides:
setValue in class Equipment
Throws:
java.lang.IllegalArgumentException

getInfantryDamage

public int getInfantryDamage(int modifiedDieRoll)
Returns the number of infantry casualties from this weapon

Parameters:
modifiedDieRoll - the modified die roll to hit the infantry unit
Returns:
the amount of casualties done to the unit