de.unifreiburg.twodeedoo.view
Class NullActivity

java.lang.Object
  extended by de.unifreiburg.twodeedoo.view.NullActivity
All Implemented Interfaces:
IActivity, IKeyHandler, ISchedulable

public class NullActivity
extends java.lang.Object
implements IActivity

An activity which does nothing.


Field Summary
 
Fields inherited from interface de.unifreiburg.twodeedoo.view.ISchedulable
NULL_OBJECT
 
Fields inherited from interface de.unifreiburg.twodeedoo.view.IKeyHandler
NULL_OBJECT
 
Constructor Summary
NullActivity()
           
 
Method Summary
 void keyPressed(int keyCode, IGameController controller)
          a key has been pressed.
 void keyReleased(int keyCode, IGameController controller)
          a key has been released.
 int minimalTimeSlice()
          Do not call me more often than with this many ms between two runs.
 boolean run(int elapsedTimeMillis, IGameController gameController)
          Perform some work.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullActivity

public NullActivity()
Method Detail

run

public boolean run(int elapsedTimeMillis,
                   IGameController gameController)
Description copied from interface: ISchedulable
Perform some work.

Specified by:
run in interface ISchedulable
Parameters:
elapsedTimeMillis - time in ms since last call.
gameController - to stop the game or switch activities
Returns:
true: this should be run again, false: finished, don't call again.

keyPressed

public void keyPressed(int keyCode,
                       IGameController controller)
Description copied from interface: IKeyHandler
a key has been pressed.

Specified by:
keyPressed in interface IKeyHandler
Parameters:
keyCode - a code from KeyEvent, e.g. KeyEvent.VK_LEFT
controller - TODO

keyReleased

public void keyReleased(int keyCode,
                        IGameController controller)
Description copied from interface: IKeyHandler
a key has been released.

Specified by:
keyReleased in interface IKeyHandler
Parameters:
keyCode - a code from KeyEvent, e.g. KeyEvent.VK_LEFT
controller - TODO

minimalTimeSlice

public int minimalTimeSlice()
Description copied from interface: IActivity
Do not call me more often than with this many ms between two runs.

Specified by:
minimalTimeSlice in interface IActivity
Returns:
millisecond delay