org.dartra.games.cricket.visitor
Class CricketScoreVisitor

java.lang.Object
  extended byorg.dartra.games.cricket.visitor.CricketScoreVisitor
All Implemented Interfaces:
GameVisitor

public class CricketScoreVisitor
extends java.lang.Object
implements GameVisitor

Visitor to retrieve the score from a cricket game.

Author:
Bieke Meeussen

Constructor Summary
CricketScoreVisitor(boolean composed)
           
 
Method Summary
protected  int findPlace(java.lang.String goal)
           
 java.lang.String[] getGoals()
           
 int[] hits(Player player)
           
 int hitsForGoal(Player player, java.lang.String goal)
           
 int[] points(Player player)
           
 int pointsForGoal(Player player, java.lang.String goal)
           
 java.lang.Integer totalScore(Player player)
           
 void visitGame(Game game)
          Process game data.
 void visitMatch(Match match)
          Process match data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CricketScoreVisitor

public CricketScoreVisitor(boolean composed)
Method Detail

visitGame

public void visitGame(Game game)
Description copied from interface: GameVisitor

Process game data.

Specified by:
visitGame in interface GameVisitor
See Also:
GameVisitor.visitGame(org.dartra.framework.Game)

visitMatch

public void visitMatch(Match match)
Description copied from interface: GameVisitor

Process match data.

Specified by:
visitMatch in interface GameVisitor
See Also:
GameVisitor.visitMatch(org.dartra.framework.Match)

getGoals

public java.lang.String[] getGoals()

points

public int[] points(Player player)

pointsForGoal

public int pointsForGoal(Player player,
                         java.lang.String goal)

hits

public int[] hits(Player player)

hitsForGoal

public int hitsForGoal(Player player,
                       java.lang.String goal)

totalScore

public java.lang.Integer totalScore(Player player)

findPlace

protected int findPlace(java.lang.String goal)