jagafa.scores
Class AbstractScoreTable

java.lang.Object
  extended by jagafa.scores.AbstractScoreTable
All Implemented Interfaces:
ScoreTable
Direct Known Subclasses:
CoiffeurScoreTable, SchieberScoreTable

public abstract class AbstractScoreTable
extends java.lang.Object
implements ScoreTable


Field Summary
protected  int choosingPlayer_
           
 
Constructor Summary
AbstractScoreTable()
           
 
Method Summary
 void activateRule(RuleSet rule)
          Activate a RuleSet.
 void addScores(int[] scores, RuleSet rules)
          Add scores achieved with a specific RuleSet to the table.
 boolean canChangeChoosingPlayer()
           
 boolean changeChoosingPlayer()
          Does nothing by default
 void deactivateRule(RuleSet rule)
          Deactivate a RuleSet.
 java.util.List<RuleSet> getRules()
          Get a list of all activated RuleSets
 int[] getScores()
          Get all the players scores from all the rounds played
 int getStartPlayer()
          Get the player which can start the next round
 boolean isRuleAvailable(RuleSet rule)
           
 void resetScores()
          Reset all scores to 0
 int roundsPlayed()
           
protected  void setCanChangePlayer(boolean canChange)
           
protected  void setChoosingPlayer(int i)
           
 void setStartPlayer(int pindex)
          Set the player which can start the next round
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jagafa.scores.ScoreTable
getChoosingPlayer, getMultiplier, getWinningScore, isGameOver
 

Field Detail

choosingPlayer_

protected int choosingPlayer_
Constructor Detail

AbstractScoreTable

public AbstractScoreTable()
Method Detail

isRuleAvailable

public boolean isRuleAvailable(RuleSet rule)
Specified by:
isRuleAvailable in interface ScoreTable

activateRule

public void activateRule(RuleSet rule)
Description copied from interface: ScoreTable
Activate a RuleSet. The RuleSet can be chosen after activation

Specified by:
activateRule in interface ScoreTable

deactivateRule

public void deactivateRule(RuleSet rule)
Description copied from interface: ScoreTable
Deactivate a RuleSet. The RuleSet is not a valid choice afterwards.

Specified by:
deactivateRule in interface ScoreTable

getRules

public java.util.List<RuleSet> getRules()
Description copied from interface: ScoreTable
Get a list of all activated RuleSets

Specified by:
getRules in interface ScoreTable
Returns:

addScores

public void addScores(int[] scores,
                      RuleSet rules)
Description copied from interface: ScoreTable
Add scores achieved with a specific RuleSet to the table.

Specified by:
addScores in interface ScoreTable

getScores

public int[] getScores()
Description copied from interface: ScoreTable
Get all the players scores from all the rounds played

Specified by:
getScores in interface ScoreTable
Returns:

getStartPlayer

public int getStartPlayer()
Description copied from interface: ScoreTable
Get the player which can start the next round

Specified by:
getStartPlayer in interface ScoreTable

setStartPlayer

public void setStartPlayer(int pindex)
Description copied from interface: ScoreTable
Set the player which can start the next round

Specified by:
setStartPlayer in interface ScoreTable

resetScores

public void resetScores()
Description copied from interface: ScoreTable
Reset all scores to 0

Specified by:
resetScores in interface ScoreTable

setChoosingPlayer

protected void setChoosingPlayer(int i)

roundsPlayed

public int roundsPlayed()
Specified by:
roundsPlayed in interface ScoreTable

toString

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

changeChoosingPlayer

public boolean changeChoosingPlayer()
Does nothing by default

Specified by:
changeChoosingPlayer in interface ScoreTable

canChangeChoosingPlayer

public boolean canChangeChoosingPlayer()
Specified by:
canChangeChoosingPlayer in interface ScoreTable

setCanChangePlayer

protected void setCanChangePlayer(boolean canChange)


Copyright 2005 MA Software. All Rights Reserved.