Java Universal Role Playing Engine Version 0.3.9

jurpe.items
Class WeaponAttack

java.lang.Object
  extended by jurpe.items.WeaponAttack
All Implemented Interfaces:
java.io.Serializable

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

Utility type for Attack. An attack contains up to 3 possibile types of damage (WeaponDamage): cutting, crushing, impalling. If an attack does not contain one of the specified types of damage, the corresponding WeaponDamage is valued to WeaponDamage.NONE (Nothing)

See Also:
Serialized Form

Constructor Summary
WeaponAttack(WeaponDamage dTaglio, WeaponDamage dBotta, WeaponDamage dImpalamento)
          Constructs new type for Attacks available for a weapon.
 
Method Summary
 java.lang.String[] getAttacks()
          Return an array of String determining a long description for each available Attack
 WeaponDamage getCrushingDamage()
          Return Crushing WeaponDamage
 WeaponDamage getCuttingDamage()
          Return Cutting WeaponDamage
 WeaponDamage getImpalingDamage()
          Return Impaling WeaponDamage
 int getIndexAttacks(DamageMode weaponMode)
          If getAttacks returns 3 different types of attacks, when you pass the mode for this weapon, ie: Weapon.MODE_IMP, this method returns the position of that mode in that array.
 int getNumAttacks()
          Get the number of available attacks for this weapon (0-3)
 java.lang.String toString()
          Long description of all available attack for this weapon.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WeaponAttack

public WeaponAttack(WeaponDamage dTaglio,
                    WeaponDamage dBotta,
                    WeaponDamage dImpalamento)
Constructs new type for Attacks available for a weapon.

Parameters:
dTaglio - WeaponDamage for cutting mode
dBotta - WeaponDamage for crushing mode
dImpalamento - WeaponDamage for impaling mode
Method Detail

getCuttingDamage

public WeaponDamage getCuttingDamage()
Return Cutting WeaponDamage

Returns:
Cutting WeaponDamage
See Also:
WeaponDamage

getCrushingDamage

public WeaponDamage getCrushingDamage()
Return Crushing WeaponDamage

Returns:
Crushing WeaponDamage
See Also:
WeaponDamage

getImpalingDamage

public WeaponDamage getImpalingDamage()
Return Impaling WeaponDamage

Returns:
Impaling WeaponDamage
See Also:
WeaponDamage

getNumAttacks

public int getNumAttacks()
Get the number of available attacks for this weapon (0-3)

Returns:
The number of available attacks

getAttacks

public java.lang.String[] getAttacks()
Return an array of String determining a long description for each available Attack

Returns:
Strings describing available attacks

getIndexAttacks

public int getIndexAttacks(DamageMode weaponMode)
If getAttacks returns 3 different types of attacks, when you pass the mode for this weapon, ie: Weapon.MODE_IMP, this method returns the position of that mode in that array.

Parameters:
weaponMode - The weapon mode as in Weapon (MODE_CRU, MODE_CUT, MODE_IMP)
Returns:
index of given weapon mode.

toString

public java.lang.String toString()
Long description of all available attack for this weapon.

Overrides:
toString in class java.lang.Object
Returns:
Long description of all available attack for this weapon.

Java Universal Role Playing Engine Version 0.3.9

Copyright ? 2010 http://jurpe.sourceforge.net/ All Rights Reserved.