All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pinball.Stats

java.lang.Object
   |
   +----pinball.Stats

public class Stats
extends Object
Used to keep track of the statistics of the game.


Variable Index

 o ballInPlay
Is a ball in play.
 o ballLaunchable
Is the ball launchable.
 o ballLaunched
Was the ball launched.
 o balls
Number of balls played.
 o ballTime
Time for that ball.
 o hits
Number of times hit.
 o hitsTotal
Total number of hits.
 o lastCheckedLaunchable
When was the ball last checked for being launchable.
 o lastSeen
The time the ball was last seen.
 o lastTime
Last time.
 o launchTime
Time to wait from the time the ball is out of play, before launching the ball.
 o missingTime
The amount of time a ball can be missing until it's considered out of play.
 o startBallTime
Time ball started.
 o startButton
Use to check for a start of a new game.
 o startGameTime
Time game started.
 o stoppedTime
Time when the ball was out of play.
 o stub
The pinball controlls of the system.
 o totalTime
Total time spent playing.

Constructor Index

 o Stats(Stub)
Checks the stats of the game.

Method Index

 o avgBallTime()
Get the average time the ball was in play.
 o avgHits()
Get the average number of hits.
 o ballAlive()
The ball is found in the system.
 o ballDisappeared()
The ball was not found in the system.
 o ballDone()
Ball is out of play.
 o ballInPlay()
Ball is in play.
 o ballInPlay(boolean)
Set "ball is in play" status.
 o ballLaunchable()
Check if the ball is about to be lanuched.
 o balls()
Get the number of balls played.
 o ballsInc()
Increment the number of balls played so far.
 o ballTime()
Get the total time the ball was in play.
 o hits()
Get the number of hits.
 o hitsInc()
Ball was hit, increment the number of hits.
 o newBall()
Reset the statistics for a new ball.
 o newGame()
Reset the statistics for a new game.
 o statsDone()
Check to see if the system is done doing the statistics for the game.
 o totalTime()
Get the total time the game was in use.

Variables

 o balls
 protected int balls
Number of balls played.

 o hits
 protected int hits
Number of times hit.

 o hitsTotal
 protected int hitsTotal
Total number of hits.

 o startGameTime
 protected long startGameTime
Time game started.

 o startBallTime
 protected long startBallTime
Time ball started.

 o lastTime
 protected long lastTime
Last time. Can be used to test for no movement.

 o ballInPlay
 protected boolean ballInPlay
Is a ball in play.

 o totalTime
 protected long totalTime
Total time spent playing.

 o ballTime
 protected long ballTime
Time for that ball.

 o stub
 protected Stub stub
The pinball controlls of the system.

 o launchTime
 protected final long launchTime
Time to wait from the time the ball is out of play, before launching the ball.

 o lastSeen
 protected long lastSeen
The time the ball was last seen.

 o missingTime
 protected final long missingTime
The amount of time a ball can be missing until it's considered out of play.

 o ballLaunchable
 protected boolean ballLaunchable
Is the ball launchable.

 o ballLaunched
 protected boolean ballLaunched
Was the ball launched.

 o stoppedTime
 protected long stoppedTime
Time when the ball was out of play.

 o lastCheckedLaunchable
 protected long lastCheckedLaunchable
When was the ball last checked for being launchable.

 o startButton
 protected StartButton startButton
Use to check for a start of a new game.

Constructors

 o Stats
 public Stats(Stub s)
Checks the stats of the game.

Parameters:
s - the the Stub used for locating the ball.

Methods

 o totalTime
 public long totalTime()
Get the total time the game was in use.

Returns:
time in use.
 o hitsInc
 public void hitsInc()
Ball was hit, increment the number of hits.

 o hits
 public int hits()
Get the number of hits.

Returns:
number of hits for this ball.
 o ballsInc
 public void ballsInc()
Increment the number of balls played so far.

 o balls
 public int balls()
Get the number of balls played.

Returns:
number of balls played.
 o newBall
 public void newBall()
Reset the statistics for a new ball.

 o newGame
 public void newGame()
Reset the statistics for a new game.

 o ballTime
 public long ballTime()
Get the total time the ball was in play.

Returns:
time in use.
 o avgBallTime
 public float avgBallTime()
Get the average time the ball was in play.

Returns:
time in use.
 o avgHits
 public float avgHits()
Get the average number of hits.

Returns:
average number of hits.
 o ballDone
 public void ballDone()
Ball is out of play. Calculate statistics.

 o statsDone
 public void statsDone()
Check to see if the system is done doing the statistics for the game. System will exit when the testing is done.

 o ballLaunchable
 public boolean ballLaunchable()
Check if the ball is about to be lanuched.

Returns:
Launchable status.
 o ballDisappeared
 public void ballDisappeared()
The ball was not found in the system.

 o ballAlive
 public void ballAlive()
The ball is found in the system.

 o ballInPlay
 public boolean ballInPlay()
Ball is in play.

 o ballInPlay
 public void ballInPlay(boolean b)
Set "ball is in play" status.

Parameters:
b - call in play status.

All Packages  Class Hierarchy  This Package  Previous  Next  Index