|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmoagg.model.weapon.AbstractWeapon
public abstract class AbstractWeapon
This is an abstract implementation of a weapon delegating the having the ability to inject a fire strategy.
| Constructor Summary | |
|---|---|
AbstractWeapon()
|
|
| Method Summary | |
|---|---|
boolean |
isShoot()
Called by the game control (via the game object) in each frame. |
void |
setFireStrategy(FireStrategy fireStrategy)
|
void |
setShoot(boolean shoot)
Normally this method is called by the game object in each frame. |
void |
update(long elapsedTime)
Must be called by the game object for each frame, since weapon implementations may have internal timers of some kind. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractWeapon()
| Method Detail |
|---|
public void setFireStrategy(FireStrategy fireStrategy)
public void update(long elapsedTime)
Weapon
update in interface Weaponpublic boolean isShoot()
Weapon
isShoot in interface Weaponpublic void setShoot(boolean shoot)
Weapon
setShoot in interface Weaponshoot - true if the "fire button is pressed", else false.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||