|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gamekeeper2a.GameResult
Information about a single, completed game.
Constructor Summary | |
GameResult(java.lang.String rawInfoString)
Creates a new instance of GameResult. |
|
GameResult(java.lang.String rawInfoString,
boolean highScoreWins)
Creates a new instance of GameResult. |
|
GameResult(java.lang.String name1,
int score1,
java.lang.String name2,
int score2)
Figure out the game result, under the default assumption that high score wins. |
|
GameResult(java.lang.String name1,
int score1,
java.lang.String name2,
int score2,
boolean highScoreWins)
Figure out the game result. |
Method Summary | |
boolean |
equals(java.lang.Object otherResult)
|
java.lang.String |
getLoserName()
Tells the name of the loser of the match. |
int |
getLoserScore()
Tells the score of the loser. |
java.lang.String |
getWinnerName()
Tells the name of the winner of the match. |
int |
getWinnerScore()
Tells the score of the winner. |
int |
hashCode()
|
boolean |
isDraw()
Tells if this match is a draw (true) or not (false). |
static void |
main(java.lang.String[] args)
Purely for testing. |
java.lang.String |
toString()
Make a nice, one-line printable string. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public GameResult(java.lang.String rawInfoString)
public GameResult(java.lang.String rawInfoString, boolean highScoreWins)
highScoreWins
- true if high score wins the game, false
if low score wins.rawInfoString
- a string giving the game result.
Valid strings have this format:
public GameResult(java.lang.String name1, int score1, java.lang.String name2, int score2)
public GameResult(java.lang.String name1, int score1, java.lang.String name2, int score2, boolean highScoreWins)
highScoreWins
- true if high score wins false if low score wins.Method Detail |
public boolean equals(java.lang.Object otherResult)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String getLoserName()
getLoserName
in interface IGameResult
public int getLoserScore()
getLoserScore
in interface IGameResult
public boolean isDraw()
isDraw
in interface IGameResult
public java.lang.String getWinnerName()
getWinnerName
in interface IGameResult
public int getWinnerScore()
getWinnerScore
in interface IGameResult
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |