001 package jagafa.scores;
002
003 import jagafa.rule.RuleSet;
004
005 import java.util.List;
006
007 public interface ScoreTable {
008 public abstract boolean isRuleAvailable(RuleSet rule);
009
010 /**
011 * Activate a RuleSet. The RuleSet can be chosen after activation
012 * @param rule
013 */
014 public abstract void activateRule(RuleSet rule);
015
016 /**
017 * Deactivate a RuleSet. The RuleSet is not a valid choice afterwards.
018 * @param rule
019 */
020 public abstract void deactivateRule(RuleSet rule);
021
022 /**
023 * Get a list of all activated RuleSets
024 * @return
025 */
026 public abstract List<RuleSet> getRules();
027
028
029 /**
030 * Add scores achieved with a specific RuleSet to the table.
031 * @param scores
032 * @param rules
033 */
034 public abstract void addScores(int scores[], RuleSet rules);
035
036 /**
037 * Get all the players scores from all the rounds played
038 * @return
039 */
040 public abstract int[] getScores();
041
042 /**
043 * Reset all scores to 0
044 *
045 */
046 public abstract void resetScores();
047
048 /**
049 * Check wether the Game is over or not
050 * @return
051 */
052 public abstract boolean isGameOver();
053
054
055 /**
056 * Set the player which can start the next round
057 * @param p
058 */
059 public abstract void setStartPlayer(int pindex);
060
061 /**
062 * Get the player which can start the next round
063 */
064 public abstract int getStartPlayer();
065
066 /**
067 * Change internally the player which can choose the RuleSet.
068 * (Often: Triggered by a Player who doesn't want to choose -> hand the
069 * choice over to another player)
070 */
071 public abstract boolean changeChoosingPlayer();
072
073 public abstract boolean canChangeChoosingPlayer();
074 /**
075 * Get the player which can choose the ruleSet for the next round
076 * @return The next choosing Player
077 */
078 public abstract int getChoosingPlayer();
079
080 /**
081 * Returns the multiplier of an activated RuleSet.
082 * The scores added by addScores() will be multiplied by this factor for the
083 * RuleSet. (initial multiplier is 1)
084 * @param rule The RuleSet of which the scores will be multiplied
085 * @return The Multiplier (int)
086 */
087 public abstract int getMultiplier(RuleSet rule);
088
089 public abstract int roundsPlayed();
090
091 public abstract int getWinningScore();
092
093
094 }