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.
-
ballInPlay
- Is a ball in play.
-
ballLaunchable
- Is the ball launchable.
-
ballLaunched
- Was the ball launched.
-
balls
- Number of balls played.
-
ballTime
- Time for that ball.
-
hits
- Number of times hit.
-
hitsTotal
- Total number of hits.
-
lastCheckedLaunchable
- When was the ball last checked for being launchable.
-
lastSeen
- The time the ball was last seen.
-
lastTime
- Last time.
-
launchTime
- Time to wait from the time the ball is out of play,
before launching the ball.
-
missingTime
- The amount of time a ball can be missing until it's
considered out of play.
-
startBallTime
- Time ball started.
-
startButton
- Use to check for a start of a new game.
-
startGameTime
- Time game started.
-
stoppedTime
- Time when the ball was out of play.
-
stub
- The pinball controlls of the system.
-
totalTime
- Total time spent playing.
-
Stats(Stub)
-
Checks the stats of the game.
-
avgBallTime()
- Get the average time the ball was in play.
-
avgHits()
- Get the average number of hits.
-
ballAlive()
- The ball is found in the system.
-
ballDisappeared()
-
The ball was not found in the system.
-
ballDone()
- Ball is out of play.
-
ballInPlay()
- Ball is in play.
-
ballInPlay(boolean)
- Set "ball is in play" status.
-
ballLaunchable()
- Check if the ball is about to be lanuched.
-
balls()
- Get the number of balls played.
-
ballsInc()
- Increment the number of balls played so far.
-
ballTime()
- Get the total time the ball was in play.
-
hits()
- Get the number of hits.
-
hitsInc()
- Ball was hit, increment the number of hits.
-
newBall()
- Reset the statistics for a new ball.
-
newGame()
- Reset the statistics for a new game.
-
statsDone()
- Check to see if the system is done doing the statistics for the game.
-
totalTime()
- Get the total time the game was in use.
balls
protected int balls
- Number of balls played.
hits
protected int hits
- Number of times hit.
hitsTotal
protected int hitsTotal
- Total number of hits.
startGameTime
protected long startGameTime
- Time game started.
startBallTime
protected long startBallTime
- Time ball started.
lastTime
protected long lastTime
- Last time. Can be used to test for no movement.
ballInPlay
protected boolean ballInPlay
- Is a ball in play.
totalTime
protected long totalTime
- Total time spent playing.
ballTime
protected long ballTime
- Time for that ball.
stub
protected Stub stub
- The pinball controlls of the system.
launchTime
protected final long launchTime
- Time to wait from the time the ball is out of play,
before launching the ball.
lastSeen
protected long lastSeen
- The time the ball was last seen.
missingTime
protected final long missingTime
- The amount of time a ball can be missing until it's
considered out of play.
ballLaunchable
protected boolean ballLaunchable
- Is the ball launchable.
ballLaunched
protected boolean ballLaunched
- Was the ball launched.
stoppedTime
protected long stoppedTime
- Time when the ball was out of play.
lastCheckedLaunchable
protected long lastCheckedLaunchable
- When was the ball last checked for being launchable.
startButton
protected StartButton startButton
- Use to check for a start of a new game.
Stats
public Stats(Stub s)
- Checks the stats of the game.
- Parameters:
- s - the the Stub used for locating the ball.
totalTime
public long totalTime()
- Get the total time the game was in use.
- Returns:
- time in use.
hitsInc
public void hitsInc()
- Ball was hit, increment the number of hits.
hits
public int hits()
- Get the number of hits.
- Returns:
- number of hits for this ball.
ballsInc
public void ballsInc()
- Increment the number of balls played so far.
balls
public int balls()
- Get the number of balls played.
- Returns:
- number of balls played.
newBall
public void newBall()
- Reset the statistics for a new ball.
newGame
public void newGame()
- Reset the statistics for a new game.
ballTime
public long ballTime()
- Get the total time the ball was in play.
- Returns:
- time in use.
avgBallTime
public float avgBallTime()
- Get the average time the ball was in play.
- Returns:
- time in use.
avgHits
public float avgHits()
- Get the average number of hits.
- Returns:
- average number of hits.
ballDone
public void ballDone()
- Ball is out of play. Calculate statistics.
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.
ballLaunchable
public boolean ballLaunchable()
- Check if the ball is about to be lanuched.
- Returns:
- Launchable status.
ballDisappeared
public void ballDisappeared()
- The ball was not found in the system.
ballAlive
public void ballAlive()
- The ball is found in the system.
ballInPlay
public boolean ballInPlay()
- Ball is in play.
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