Class Attack

java.lang.Object
  |
  +--Attack

public class Attack
extends java.lang.Object

Defines an ADT for Attacks.

See Also:
Monster

Field Summary
static double DAMAGE1
          The Damage associated with the first Attack learned (A1)
static double DAMAGE2
          The Damage associated with the second Attack learned (A2)
static double DAMAGE3
          The Damage associated with the third Attack learned (A3)
static double DAMAGE4
          The Damage associated with the fourth Attack learned (A4)
static double DAMAGE5
          The Damage associated with the fifth Attack learned (A5)
static double DAMAGE6
          The Damage associated with the sixth Attack learned (A6)
static double DAMAGEMULT
          The Multiplier to use if the Monster is a weak type against the other Monster
 
Constructor Summary
Attack(java.lang.String name, double pow)
          Constructs a new Attack with name and power.
 
Method Summary
 boolean equals(Attack a)
          Compares the Attack to this.
 boolean equals(java.lang.Object o)
          Compares the Object to this.
 java.lang.String getName()
          Get the name associated with the Attack.
 double getPower()
          Gets the power of the Attack
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DAMAGE1

public static double DAMAGE1
The Damage associated with the first Attack learned (A1)


DAMAGE2

public static double DAMAGE2
The Damage associated with the second Attack learned (A2)


DAMAGE3

public static double DAMAGE3
The Damage associated with the third Attack learned (A3)


DAMAGE4

public static double DAMAGE4
The Damage associated with the fourth Attack learned (A4)


DAMAGE5

public static double DAMAGE5
The Damage associated with the fifth Attack learned (A5)


DAMAGE6

public static double DAMAGE6
The Damage associated with the sixth Attack learned (A6)


DAMAGEMULT

public static final double DAMAGEMULT
The Multiplier to use if the Monster is a weak type against the other Monster

See Also:
Monster, Constant Field Values
Constructor Detail

Attack

public Attack(java.lang.String name,
              double pow)
       throws InvalidPowerException
Constructs a new Attack with name and power.

Parameters:
name - The name of the Attack
pow - the Power of the attack (0<=x<=.5)
Throws:
InvalidPowerException - if pow is not this.DAMAGE*
Method Detail

getName

public java.lang.String getName()
Get the name associated with the Attack.

Returns:
the name of this Attack

getPower

public double getPower()
Gets the power of the Attack

Returns:
the power of the Attack

equals

public boolean equals(java.lang.Object o)
Compares the Object to this.

Overrides:
equals in class java.lang.Object
Parameters:
o - the Object to compare with this
Returns:
true if equal, false otherwise.

equals

public boolean equals(Attack a)
Compares the Attack to this. Uses Power to determine equality.

Returns:
true if equal, false otherwise.