Class MonsterBallItem

java.lang.Object
  |
  +--Item
        |
        +--MonsterBallItem

public class MonsterBallItem
extends Item

Simple class for an Item used to catch Monsters

See Also:
Monster, Item

Field Summary
static int MASTER
          Master MonsterBall subBrand
static int NORMAL
          Normal MonsterBall subBrand
 
Fields inherited from class Item
brand, MONSTERBALL, name, number, POTION
 
Constructor Summary
MonsterBallItem(java.lang.String name, int subBrand)
          Construct a MonsterBallItem based upon name and subBrand.
 
Method Summary
 int getSubBrand()
          Gets the subBrand of this
 boolean useItem(Monster m)
          Attempts to use the MonsterBall on the Monster.
 
Methods inherited from class Item
addItem, equals, equals, getBrand, getItemCount, getName, setItemCount, setName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NORMAL

public static final int NORMAL
Normal MonsterBall subBrand

See Also:
Constant Field Values

MASTER

public static final int MASTER
Master MonsterBall subBrand

See Also:
Constant Field Values
Constructor Detail

MonsterBallItem

public MonsterBallItem(java.lang.String name,
                       int subBrand)
Construct a MonsterBallItem based upon name and subBrand.

Parameters:
name - The name for this
subBrand - the subBrand as defined above
Method Detail

getSubBrand

public int getSubBrand()
Gets the subBrand of this

Specified by:
getSubBrand in class Item
Returns:
the subBrand of this
See Also:
MonsterBallItem, PotionItem

useItem

public boolean useItem(Monster m)
Attempts to use the MonsterBall on the Monster. If this is successful then returns true, else returns false. Needs to be passed the opposing Monster the Player is trying to catch

Specified by:
useItem in class Item
Parameters:
m - the opposing Monster trying to catch
Returns:
true iff Monster was able to be caught, still needs to be added to Player. Else false
See Also:
Player, Monster