|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavoids.Item
javoids.Weapon
public class Weapon
A class to represent a game weapon.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javoids.Item |
---|
Item.Direction, Item.Type |
Field Summary | |
---|---|
private ImageMap.Name |
bulletImage
the weapon's regular image |
private int |
damage
the weapon damage per bullet |
private int |
directions
the number of directions the weapon fires |
private int |
fired
the number of bullets fired |
private ImageMap.Name |
homingImage
the homing image (for display in the panel) |
private int |
homings
the number of hoing bullets the weapon has |
private int |
maximumFired
the maximum number of times the weapon can be fired |
private int |
range
the range of the weapon |
private static long |
serialVersionUID
This is the version used for serializing/deserializing (storing/retrieving) this object |
private ImageMap.Name |
shieldedHomingImage
the shielded homing image (for display in the panel) |
private ImageMap.Name |
shieldedImage
the shielded image (for display in the panel) |
private int |
shields
the number of sheidled bullets the weapon has |
private int |
velocity
the velocity of the bullets fired from this weapon |
Constructor Summary | |
---|---|
Weapon()
Constructor (default) |
|
Weapon(Weapon weapon)
Constructor (copy) |
Method Summary | |
---|---|
ImageMap.Name |
getBulletImage()
|
int |
getDamage()
|
int |
getDirections()
|
int |
getFired()
|
ImageMap.Name |
getHomingImage()
|
int |
getHomings()
|
ImageMap.Name |
getImage()
|
int |
getMaximumFired()
|
int |
getRange()
|
ImageMap.Name |
getShieldedHomingImage()
|
ImageMap.Name |
getShieldedImage()
|
int |
getShields()
|
int |
getVelocity()
|
void |
modifyFired(int _count)
|
void |
modifyHomings(int _count)
|
void |
modifyShields(int _count)
|
void |
reset()
Reset the item properties to the default values. |
void |
setBulletImage(ImageMap.Name _bulletImage)
|
void |
setDamage(int _damage)
|
void |
setDirections(int _directions)
|
void |
setFired(int _fired)
|
void |
setHomingImage(ImageMap.Name _homingImage)
|
void |
setHomings(int _homings)
|
void |
setMaximumFired(int _maximumFired)
|
void |
setRange(int _range)
|
void |
setShieldedHomingImage(ImageMap.Name _shieldedHomingImage)
|
void |
setShieldedImage(ImageMap.Name _shieldedImage)
|
void |
setShields(int _shields)
|
void |
setType(Item.Type _type)
|
void |
setVelocity(int _velocity)
|
java.lang.String |
toString()
Provide a String representation of this object. |
Methods inherited from class javoids.Item |
---|
cycleWeapon, getCount, getDefaultCount, getDefaultImage, getMaximumCount, getName, getSize, getSound, getType, isLimitless, isWeapon, isWeapon, modifyCount, setCount, setDefaultCount, setDefaultImage, setImage, setItem, setLimitless, setMaximumCount, setName, setSize, setSound, setWeapon |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private ImageMap.Name bulletImage
private ImageMap.Name shieldedImage
private ImageMap.Name homingImage
private ImageMap.Name shieldedHomingImage
private int damage
private int maximumFired
private int range
private int velocity
private int directions
private int shields
private int homings
private int fired
Constructor Detail |
---|
public Weapon()
public Weapon(Weapon weapon)
weapon
- the wepon to be copiedMethod Detail |
---|
public ImageMap.Name getBulletImage()
public ImageMap.Name getShieldedImage()
public ImageMap.Name getHomingImage()
public ImageMap.Name getShieldedHomingImage()
public int getDamage()
public int getMaximumFired()
public int getRange()
public int getVelocity()
public int getDirections()
public int getShields()
public int getHomings()
public int getFired()
public ImageMap.Name getImage()
getImage
in class Item
public void setType(Item.Type _type)
setType
in class Item
_type
- the item namepublic void setBulletImage(ImageMap.Name _bulletImage)
_bulletImage
- the image to give this weapon's bulletspublic void setShieldedImage(ImageMap.Name _shieldedImage)
_shieldedImage
- the image to give this weapon's shielded bullets (or to use in the toolbar)public void setHomingImage(ImageMap.Name _homingImage)
_homingImage
- the image to give this weapon's homing bullets (or to use in the toolbar)public void setShieldedHomingImage(ImageMap.Name _shieldedHomingImage)
_shieldedHomingImage
- the image to give this weapon's shielded homing bullets (or to use in the toolbar)public void setDamage(int _damage)
_damage
- the base damage to inflict per hitpublic void setMaximumFired(int _maximumFired)
_maximumFired
- the maximum number of times the weapon can be fired before needing to pausedpublic void setRange(int _range)
_range
- the range the fired bullets can travelpublic void setVelocity(int _velocity)
_velocity
- the bullet velocitypublic void setDirections(int _directions)
_directions
- the number of directions to shoot inpublic void setShields(int _shields)
_shields
- the number of shots that will be shieldedpublic void setHomings(int _homings)
_homings
- the number of shots that will be homingpublic void setFired(int _fired)
_fired
- the number of shots that can be fired at oncepublic void reset()
reset
in class Item
public void modifyShields(int _count)
_count
- the additional number of shots that will be shieldedpublic void modifyHomings(int _count)
_count
- the additional number of shots that will be homingpublic void modifyFired(int _count)
_count
- the additional number of shots that were firedpublic java.lang.String toString()
toString
in class Item
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |