Jacson

de.spieleck.app.turn
Interface ScoringMode

All Superinterfaces:
LineSourceInited
All Known Implementing Classes:
BaseScoring, Chess, Mue, Zoff

public interface ScoringMode
extends LineSourceInited

Represents a way how games and players are scored.
ScoringMode is actually factories (GoF pattern) for implementations of PlayerGameScore and PlayerScore.

$URL: https://svn.sourceforge.net/svnroot/jtourney/src/de/spieleck/app/turn/ScoringMode.java $

Version:
$Revision: 2 $ $Date: 2006-03-20 14:33:27 +0100 (Mo, 20 Mrz 2006) $ $Author: nestefan $
Author:
Frank S. Nestel, $Author: nestefan $

Method Summary
 PlayerScore add(PlayerScore p, PlayerGameScore pgs)
          Accumulate the total score of a player with the outcome of one game.
 PlayerScore addPlayers(PlayerScore p1, PlayerScore p2)
          Accumulate player total scores to another total for tiebreaking reasons.
 PlayerGameScore[] adjustScore(PlayerGameScore[] raw)
          Perform adjustments on the playerscores of a game.
 java.lang.String checkScore(PlayerGameScore[] raw)
          Return error when scores are not fitting together.
 PlayerScore initialValue()
          Generate an initial score for a players tournament start.
 PlayerGameScore parseRawScore(java.lang.String line)
          Parse a single players score from a String.
 PlayerGameScore zeroScore()
          Generate a zero score for a game with yet no outcome.
 
Methods inherited from interface de.spieleck.app.turn.LineSourceInited
init
 

Method Detail

parseRawScore

PlayerGameScore parseRawScore(java.lang.String line)
                              throws java.lang.Exception
Parse a single players score from a String.

Throws:
java.lang.Exception

checkScore

java.lang.String checkScore(PlayerGameScore[] raw)
Return error when scores are not fitting together. I.e. for chess the sum of all (=2) player scores must be 1 and it can actually only be 1:0, 0.5:0.5 or 0:1.


adjustScore

PlayerGameScore[] adjustScore(PlayerGameScore[] raw)
Perform adjustments on the playerscores of a game. This is useful for do some normalization of individual scores depending on total scores in a game.


add

PlayerScore add(PlayerScore p,
                PlayerGameScore pgs)
Accumulate the total score of a player with the outcome of one game.


addPlayers

PlayerScore addPlayers(PlayerScore p1,
                       PlayerScore p2)
Accumulate player total scores to another total for tiebreaking reasons. With the right implementation of chess scores, this results in a Buchholz score.


initialValue

PlayerScore initialValue()
Generate an initial score for a players tournament start.


zeroScore

PlayerGameScore zeroScore()
Generate a zero score for a game with yet no outcome.


spieleck.de