Class Yatzy

java.lang.Object
io.github.mathieusoysal.Yatzy

public class Yatzy extends Object
The Yatzy class provides static methods for calculating scores for the Yatzy game.
Author:
MathieuSoysal
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    Calculate the score for the given category YatzyMod based on the given set of dice Dices.
    static int
    chance(Dices dices)
    Calculate the score for the "Chance" category based on the given set of dice.
    static int
    fives(Dices dices)
    Calculate the score for the "Fives" category based on the given set of dice.
    static int
    Calculate the score for the "Four of a Kind" category based on the given set of dice.
    static int
    fours(Dices dices)
    Calculate the score for the "Fours" category based on the given set of dice.
    static int
    Calculate the score for the "Full House" category based on the given set of dice.
    static int
    Calculate the score for the "Large Straight" category based on the given set of dice.
    static int
    ones(Dices dices)
    Calculate the score for the "Ones" category based on the given set of dice.
    static int
    pair(Dices dices)
    Calculate the score for the "Pair" category based on the given set of dice.
    static int
    sixes(Dices dices)
    Calculate the score for the "Sixes" category based on the given set of dice.
    static int
    Calculate the score for the "Small Straight" category based on the given set of dice.
    static int
    Calculate the score for the "Three of a Kind" category based on the given set of dice.
    static int
    threes(Dices dices)
    Calculate the score for the "Threes" category based on the given set of dice.
    static int
    twoPairs(Dices dices)
    Calculate the score for the "Two Pairs" category based on the given set of dice.
    static int
    twos(Dices dices)
    Calculate the score for the "Twos" category based on the given set of dice.
    static int
    yatzy(Dices dices)
    Calculate the score for the "Yatzy" category based on the given set of dice.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • calculateScore

      public static int calculateScore(YatzyMod mod, Dices dices)
      Calculate the score for the given category YatzyMod based on the given set of dice Dices.
      Parameters:
      mod - The category to calculate the score for.
      dices - The set of dice.
      Returns:
      The calculated score for the given category.
      See Also:
    • chance

      public static int chance(Dices dices)
      Calculate the score for the "Chance" category based on the given set of dice.
      Parameters:
      dices - The set of dice.
      Returns:
      The calculated score for the "Chance" category.
      See Also:
    • yatzy

      public static int yatzy(Dices dices)
      Calculate the score for the "Yatzy" category based on the given set of dice.
      Parameters:
      dices - The set of dice.
      Returns:
      The calculated score for the "Yatzy" category.
      See Also:
    • ones

      public static int ones(Dices dices)
      Calculate the score for the "Ones" category based on the given set of dice.
      Parameters:
      dices - The set of dice.
      Returns:
      The calculated score for the "Ones" category.
      See Also:
    • twos

      public static int twos(Dices dices)
      Calculate the score for the "Twos" category based on the given set of dice.
      Parameters:
      dices - The set of dice.
      Returns:
      The calculated score for the "Twos" category.
      See Also:
    • threes

      public static int threes(Dices dices)
      Calculate the score for the "Threes" category based on the given set of dice.
      Parameters:
      dices - The set of dice.
      Returns:
      The calculated score for the "Threes" category.
      See Also:
    • fours

      public static int fours(Dices dices)
      Calculate the score for the "Fours" category based on the given set of dice.
      Parameters:
      dices - The set of dice.
      Returns:
      The calculated score for the "Fours" category.
      See Also:
    • fives

      public static int fives(Dices dices)
      Calculate the score for the "Fives" category based on the given set of dice.
      Parameters:
      dices - The set of dice.
      Returns:
      The calculated score for the "Fives" category.
    • sixes

      public static int sixes(Dices dices)
      Calculate the score for the "Sixes" category based on the given set of dice.
      Parameters:
      dices - The set of dice.
      Returns:
      The calculated score for the "Sixes" category.
      See Also:
    • pair

      public static int pair(Dices dices)
      Calculate the score for the "Pair" category based on the given set of dice.
      Parameters:
      dices - The set of dice.
      Returns:
      The calculated score for the "Pair" category.
      See Also:
    • twoPairs

      public static int twoPairs(Dices dices)
      Calculate the score for the "Two Pairs" category based on the given set of dice.
      Parameters:
      dices - The set of dice.
      Returns:
      The calculated score for the "Two Pairs" category.
    • fourOfAKind

      public static int fourOfAKind(Dices dices)
      Calculate the score for the "Four of a Kind" category based on the given set of dice.
      Parameters:
      dices - The set of dice.
      Returns:
      The calculated score for the "Four of a Kind" category.
    • threeOfAKind

      public static int threeOfAKind(Dices dices)
      Calculate the score for the "Three of a Kind" category based on the given set of dice.
      Parameters:
      dices - The set of dice.
      Returns:
      The calculated score for the "Three of a Kind" category.
      See Also:
    • smallStraight

      public static int smallStraight(Dices dices)
      Calculate the score for the "Small Straight" category based on the given set of dice.
      Parameters:
      dices - The set of dice.
      Returns:
      The calculated score for the "Small Straight" category.
      See Also:
    • largeStraight

      public static int largeStraight(Dices dices)
      Calculate the score for the "Large Straight" category based on the given set of dice.
      Parameters:
      dices - The set of dice.
      Returns:
      The calculated score for the "Large Straight" category.
      See Also:
    • fullHouse

      public static int fullHouse(Dices dices)
      Calculate the score for the "Full House" category based on the given set of dice.
      Parameters:
      dices - The set of dice.
      Returns:
      The calculated score for the "Full House" category.
      See Also: