Jacson

de.spieleck.app.turn.scoring
Class Chess

java.lang.Object
  extended by de.spieleck.app.turn.scoring.BaseScoring
      extended by de.spieleck.app.turn.scoring.Chess
All Implemented Interfaces:
LineSourceInited, ScoringMode

public class Chess
extends BaseScoring

A ScoringMode for chess results.
Only knows 1:0, 0.5:0.5, 0:1 as results.

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

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

Nested Class Summary
static class Chess.ChessScore
           
 
Constructor Summary
Chess()
           
 
Method Summary
 PlayerScore addPlayers(PlayerScore ps, PlayerScore pgs)
          Accumulate player total scores to another total for tiebreaking reasons.
 PlayerGameScore[] adjustScore(PlayerGameScore[] pgs)
          Perform adjustments on the playerscores of a game.
 java.lang.String checkScore(PlayerGameScore[] pgs)
          Return error when scores are not fitting together.
 PlayerGameScore parseRawScore(java.lang.String line)
          Parse a single players score from a String.
 java.lang.String toString()
           
 PlayerGameScore zeroScore()
          Generate a zero score for a game with yet no outcome.
 
Methods inherited from class de.spieleck.app.turn.scoring.BaseScoring
add, init, initialValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Chess

public Chess()
Method Detail

parseRawScore

public PlayerGameScore parseRawScore(java.lang.String line)
Description copied from interface: ScoringMode
Parse a single players score from a String.


checkScore

public java.lang.String checkScore(PlayerGameScore[] pgs)
Description copied from interface: ScoringMode
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.

Specified by:
checkScore in interface ScoringMode
Overrides:
checkScore in class BaseScoring

adjustScore

public PlayerGameScore[] adjustScore(PlayerGameScore[] pgs)
Description copied from interface: ScoringMode
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.


zeroScore

public PlayerGameScore zeroScore()
Description copied from interface: ScoringMode
Generate a zero score for a game with yet no outcome.


addPlayers

public PlayerScore addPlayers(PlayerScore ps,
                              PlayerScore pgs)
Description copied from interface: ScoringMode
Accumulate player total scores to another total for tiebreaking reasons. With the right implementation of chess scores, this results in a Buchholz score.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

spieleck.de