moagg.model.weapon
Interface Weapon

All Known Subinterfaces:
FireStrategy
All Known Implementing Classes:
AbstractBarrel, AbstractBarrel, AbstractWeapon, BackDecorator, BarrelList, BarrelList, Blaster, Blaster, BlasterBarrel, ContinuousFireStrategy, DoubleDecorator, FixedBarrel, Laser, Laser, LaserBarrel, MissileLauncher, NullWeapon, RandomBarrel, SingleFireStrategy, SmartBarrel, TripleDecorator, WeaponDecorator, WeaponList

public interface Weapon

Every game object that can shoot contains a weapon of some kind implementing this interface.

See Also:
ShooterObject

Method Summary
 boolean isShoot()
          Called by the game control (via the game object) in each frame.
 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.
 

Method Detail

update

void update(long elapsedTime)
Must be called by the game object for each frame, since weapon implementations may have internal timers of some kind.


isShoot

boolean isShoot()
Called by the game control (via the game object) in each frame. This method must not modify the internal state of the weapon, because it might be called multiple times by the game control.

Returns:
true if a shot shall be fired, else false.

setShoot

void setShoot(boolean shoot)
Normally this method is called by the game object in each frame.

Parameters:
shoot - true if the "fire button is pressed", else false.


Copyright © 2008. All Rights Reserved.