moagg.model.weapon
Class NullWeapon

java.lang.Object
  extended by moagg.model.weapon.NullWeapon
All Implemented Interfaces:
Weapon

public class NullWeapon
extends java.lang.Object
implements Weapon

A null implementation that does nothing.


Constructor Summary
NullWeapon()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullWeapon

public NullWeapon()
Method Detail

update

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

Specified by:
update in interface Weapon

isShoot

public boolean isShoot()
Description copied from interface: Weapon
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.

Specified by:
isShoot in interface Weapon
Returns:
true if a shot shall be fired, else false.

setShoot

public void setShoot(boolean shoot)
Description copied from interface: Weapon
Normally this method is called by the game object in each frame.

Specified by:
setShoot in interface Weapon
Parameters:
shoot - true if the "fire button is pressed", else false.


Copyright © 2008. All Rights Reserved.