ks.domain
Class Match

java.lang.Object
  extended byks.domain.Match

public class Match
extends java.lang.Object

Used to calculate and record the top score in any game.

There is a lastTime attribute that can be used to determine "stale" matches, where a client has not responded with their 'gameOverCommand' update.


Constructor Summary
Match(Table t)
          Each match must be constructed from a specific table.
 
Method Summary
 void addScore(Status s)
          Add a user's score to the game.
 Status getBest()
          Return winner of table.
 GameResult getGameResult()
          Get GameResult (return null if not ready yet).
 java.util.Date getLastUpdateTime()
          Get time last Match was updated.
 boolean isDone()
          Determine if everyone has counted themselves in.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Match

public Match(Table t)
Each match must be constructed from a specific table.

Parameters:
t - Table for which GameOver commands are being sent.
Method Detail

addScore

public void addScore(Status s)
Add a user's score to the game.

Parameters:
s - a player on the table has turned in score.

getBest

public Status getBest()
Return winner of table.

Returns:
Status encodes the winning status information.

getGameResult

public GameResult getGameResult()
Get GameResult (return null if not ready yet).

Returns:
GameResult object to represent the table results.

getLastUpdateTime

public java.util.Date getLastUpdateTime()
Get time last Match was updated.

Returns:
Date of last update

isDone

public boolean isDone()
Determine if everyone has counted themselves in.

Returns:
boolean true if all users for Match have sent scores.