de.kosi.model.game
Class StopWatch

java.lang.Object
  |
  +--de.kosi.model.game.StopWatch

public class StopWatch
extends java.lang.Object

Implements a StopWatch for the game.

ChangeLog:

 
 $Log: StopWatch.java,v $
 Revision 1.1.1.1  2001/04/29 18:05:18  jiriki
 Imported sources from zola.

 Revision 1.2  2001/04/27 12:49:36  login
 Added Locale in user creation, improved game stopwatch

 Revision 1.1  2001/04/25 12:47:19  login
 Implemented stopwatch

 

Version:
$Revision: 1.1.1.1 $ ($Date: 2001/04/29 18:05:18 $)
Author:
Timo, Niklas, Ole

Constructor Summary
StopWatch(int direction)
          Create a new StopWatch.
 
Method Summary
 long getTime(int direction)
          Returns the portion of time a direction has used of the time for a game.
 void setActiveDirection(int direction)
          Set the currently active direction.
 void stop()
          Stop the stopwatch.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StopWatch

public StopWatch(int direction)
Create a new StopWatch.
Parameters:
direction - First active direction
Method Detail

setActiveDirection

public void setActiveDirection(int direction)
Set the currently active direction.
Parameters:
direction - Teh active direction.

stop

public void stop()
Stop the stopwatch.

getTime

public long getTime(int direction)
Returns the portion of time a direction has used of the time for a game.
Parameters:
direction - Direction the time is returned for.
Returns:
The time in millis.
Throws:
java.lang.IllegalArgumentException - If the user is not observed by this stop watch.