org.ninm.games.cardgames.common
Class DefaultScore

java.lang.Object
  |
  +--org.ninm.games.cardgames.common.DefaultScore
All Implemented Interfaces:
Score

public class DefaultScore
extends java.lang.Object
implements Score

The default implementation of the score interface

Version:
1.0
Author:
Nikolay

Field Summary
protected  java.util.Map m_announcedTricks
           
protected  java.util.Map m_gameScore
           
protected  java.util.Map m_rubberScore
           
protected  java.util.List m_teams
           
protected  java.util.Map m_totalScore
           
 
Constructor Summary
DefaultScore(java.util.List teams)
           
 
Method Summary
 void addToGameScore(Team team, int points)
           
 void addToRubberScore(Team team, int points)
           
 void addToTotalScore(Team team, int points)
           
 void addTrick(Trick trick)
           
 java.util.Map getAnnouncedTricks()
          returns a map from teams to a List of their announced tricks in the current game
 java.util.Map getGameScore()
          retuns a map from teams to their current game scores
 java.util.Map getRubberScore()
          retuns a map from teams to their current rubber scores
 java.util.Map getTotalScore()
          retuns a map from teams to their total scores
private  void initMap(java.util.Map scoreMap)
           
 void resetAnnouncedTricks()
           
 void resetGameScore()
           
 void resetRubberScore()
           
 void resetTotalScore()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_teams

protected final java.util.List m_teams

m_announcedTricks

protected final java.util.Map m_announcedTricks

m_gameScore

protected final java.util.Map m_gameScore

m_rubberScore

protected final java.util.Map m_rubberScore

m_totalScore

protected final java.util.Map m_totalScore
Constructor Detail

DefaultScore

public DefaultScore(java.util.List teams)
Method Detail

resetAnnouncedTricks

public void resetAnnouncedTricks()

initMap

private void initMap(java.util.Map scoreMap)

getTotalScore

public java.util.Map getTotalScore()
Description copied from interface: Score
retuns a map from teams to their total scores

Specified by:
getTotalScore in interface Score
Returns:
Map the teams and their total scores

getRubberScore

public java.util.Map getRubberScore()
Description copied from interface: Score
retuns a map from teams to their current rubber scores

Specified by:
getRubberScore in interface Score
Returns:
Map the teams and their current rubber scores

getGameScore

public java.util.Map getGameScore()
Description copied from interface: Score
retuns a map from teams to their current game scores

Specified by:
getGameScore in interface Score
Returns:
Map the teams and their current game scores

addToGameScore

public void addToGameScore(Team team,
                           int points)

addToRubberScore

public void addToRubberScore(Team team,
                             int points)

addToTotalScore

public void addToTotalScore(Team team,
                            int points)

addTrick

public void addTrick(Trick trick)

resetGameScore

public void resetGameScore()

resetRubberScore

public void resetRubberScore()

resetTotalScore

public void resetTotalScore()

getAnnouncedTricks

public java.util.Map getAnnouncedTricks()
Description copied from interface: Score
returns a map from teams to a List of their announced tricks in the current game

Specified by:
getAnnouncedTricks in interface Score
Returns:
Map the teams and their announced tricks in the current game

SourceForge.net Logo