package org.pegadi.server; import no.dusken.common.model.Person; import org.pegadi.games.Score; import java.util.List; /** * @author Marvin B. Lillehaug <lillehau@underdusken.no> */ public interface ScoreServer { public Score startGame(Person user, String domain); /** * Updates the score for a running game. The <code>Score</code> object must have the * same ID as the object returned by {@link #startGame}, and the client must set the * new value for score before updating. * * @param score The current score. */ public void updateScore(Score score); /** * Records the final score for a game.The <code>Score</code> object must have the * same ID as the object returned by {@link #startGame}, and the client must set the * final value for the score. * * @param score The final score. * @return The same score object, with the <code>active</code> property set to false. * @see org.pegadi.games.Score#isActive */ public Score endGame(Score score); /** * Cancels a game in progress. * * @param score The game to cancel. */ public void cancelGame(String userID, Score score); /** * Returns the <code>count</code> best scores ever. * * @param count Number of scores to return. * @param domain The game domain * @param activesOnly Only return scores from active players * @return List of scores. * @see org.pegadi.games.Score */ public List<? extends Score> getHighScore(String domain, int count, boolean activesOnly); /** * Returns the <code>count</code> best scores for the given user ID. * * @param userID user ID to return scores for. * @param count Number of scores to return. * @param domain The game domain * @return List of scores. * @see org.pegadi.games.Score */ public List<? extends Score> getUserScore(String domain, String userID, int count); /** * Returns the <code>count</code> best scores the given date. * * @param day The date to return scores from. * @param count Number of scores to return. * @param domain The game domain * @return List of scores. * @see org.pegadi.games.Score */ public List<? extends Score> getDayScore(String domain, java.util.Date day, int count); }