Class Game


public class Game extends Object
  • Constructor Details

    • Game

      public Game()
  • Method Details

    • main

      public static void main(String[] args) throws InterruptedException
      Throws:
      InterruptedException
    • checkDice

      public boolean checkDice(int dice, Player p, int countRolls)
      Parameters:
      dice - Value of dice got from rolldice()
      p - active Player
      countRolls - Counter how often the Player already rolled the dice
      Returns:
      true if Player can roll the dice another time
    • checkFieldClear

      public int checkFieldClear(int posToCheck, Player p, Game g)
      Parameters:
      posToCheck - Target position to check
      p - active Player
      g - game instance
      Returns:
      2 - own Player 1 - another Player 0 - Field clear
    • getUsableFigures

      public ArrayList<Integer> getUsableFigures(int dice, Player p, Game g)
      Parameters:
      dice - Value of dice got from rolldice()
      p - active Player
      g - game instance
      Returns:
      List of int with figIds the Player can choose from
    • figureIsUsable

      public boolean figureIsUsable(int dice, int figId, Player p, Game g)
      Parameters:
      dice - Value of dice got from rolldice()
      figId - id of figure to check
      p - active Player
      g - game instance
      Returns:
      true if figure is usable
    • setFigure

      public int setFigure(int figId, int dice, Player p, Game g)
      Parameters:
      figId - id of figure to check
      dice - Value of dice got from rolldice()
      p - active Player
      g - game instance
      Returns:
      0 if no figure kicked. 1 if another figure was kicked