|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectexample.wormgame.WormScore
public class WormScore
The WormScore keeps track of the high scores for each of the worm levels. All access to the scores occur through static methods. There can never be a WormScore object. We cache the scores and names for quick access during game play. The calling application must first call openHighScores() to open the score database. Finally, a closeHighScores() must be called to release system resources.
Method Summary | |
---|---|
(package private) static void |
closeHighScores()
Close the high score file |
(package private) static short |
getHighScore(int level)
Return the high score for a given level. |
(package private) static java.lang.String |
getHighScoreName(int level)
Return the high score name for a given level. |
(package private) static void |
openHighScores()
Open the high score storage file. |
(package private) static void |
setHighScore(int level,
int newScore,
java.lang.String name)
Save high score for posterity. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
static void openHighScores()
static void closeHighScores()
static void setHighScore(int level, int newScore, java.lang.String name)
level
- current game levelnewScore
- current game score to be recordedname
- current user name to be recordedstatic short getHighScore(int level)
level
- current level for high score check
static java.lang.String getHighScoreName(int level)
level
- current level for high score check
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |