Class Player


public class Player extends Object
  • Constructor Details

    • Player

      public Player(String name, int startPos, int startHome, int jumpToHome)
  • Method Details

    • rollDice

      public int rollDice()
      Returns:
      value of the dice
    • checkGameWin

      public boolean checkGameWin(ArrayList<Figure> figures)
      Parameters:
      figures - figures of the current Player
      Returns:
      true if Player has won
    • checkFigureInBase

      public int checkFigureInBase(ArrayList<Figure> figures)
      Checks if the Player has figures in the base (off gameboard)
      Parameters:
      figures - figures of the current Player
      Returns:
      true if there is at least one figure in the base (off gameboard)
    • choose

      public int choose(ArrayList<Integer> usableFigures)
      Get the user input on witch figure the user wants to move
      Parameters:
      usableFigures - list of usable Figures to choose from
      Returns:
      int figid of the figure chosen