|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Weapon
public class Weapon
This class represents a Weapon within our game. For full details of the Weapon class, see HW J6.
Constructor Summary | |
---|---|
Weapon()
The default constructor, it creates a default weapon. |
|
Weapon(int mod,
java.lang.String nm,
java.lang.String hit,
java.lang.String miss)
The specific constructor, it creates a weapon according to the passed values. |
Method Summary | |
---|---|
int |
getDamageModifier()
Returns the damage modifier for this weapon |
java.lang.String |
getFullName()
Returns the full name (including adjective) for this weapon. |
java.lang.String |
getHitVerb()
Returns the hit verb for this weapon (i.e., 'hits', 'whacks', etc.) |
java.lang.String |
getMissVerb()
Returns the miss verb for this weapon (i.e., 'misses', 'whiffs', etc.) |
java.lang.String |
getName()
Returns the base name for this weapon (i.e., 'katana', 'sai', etc.). |
void |
setDamageModifier(int dm)
Sets the damage modifier for this weapon to the passed value |
void |
setHitVerb(java.lang.String str)
Sets the hit verb for this weapon to the passed value |
void |
setMissVerb(java.lang.String str)
Sets the miss verb for this weapon to the passed value |
void |
setName(java.lang.String str)
Sets the name for this weapon to the passed value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Weapon()
public Weapon(int mod, java.lang.String nm, java.lang.String hit, java.lang.String miss)
mod
- The damage modifier of this weaponnm
- The name of this weapon (i.e., 'katana', 'sai', etc.)hit
- The hit verb for this weapon (i.e., 'hits', 'whacks', etc.)miss
- The miss verb for this weapon (i.e., 'misses',
'whiffs', etc.)Method Detail |
---|
public int getDamageModifier()
public java.lang.String getFullName()
public java.lang.String getName()
getFullName()
method.
public java.lang.String getMissVerb()
public java.lang.String getHitVerb()
public void setDamageModifier(int dm)
dm
- The new damage modifierpublic void setName(java.lang.String str)
str
- The new namepublic void setMissVerb(java.lang.String str)
str
- The new miss verbpublic void setHitVerb(java.lang.String str)
str
- The new hit verb
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |