Class Game
java.lang.Object
Game
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Check if the Player is allowed to roll the dice againint
checkFieldClear
(int posToCheck, Player p, Game g) Check if a target field is free or occupied by another figureboolean
figureIsUsable
(int dice, int figId, Player p, Game g) Check if a figure is usablegetUsableFigures
(int dice, Player p, Game g) Get List of all usable Figures in the current Play for one Playerstatic void
int
Set a figure on a field according
-
Constructor Details
-
Game
public Game()
-
-
Method Details
-
main
- Throws:
InterruptedException
-
checkDice
Check if the Player is allowed to roll the dice again- Parameters:
dice
- Value of dice got from rolldice()p
- active PlayercountRolls
- Counter how often the Player already rolled the dice- Returns:
- true if Player can roll the dice another time
-
checkFieldClear
Check if a target field is free or occupied by another figure- Parameters:
posToCheck
- Target position to checkp
- active Playerg
- game instance- Returns:
- 2 - own Player 1 - another Player 0 - Field clear
-
getUsableFigures
Get List of all usable Figures in the current Play for one Player- Parameters:
dice
- Value of dice got from rolldice()p
- active Playerg
- game instance- Returns:
- List of int with figIds the Player can choose from
-
figureIsUsable
Check if a figure is usable- Parameters:
dice
- Value of dice got from rolldice()figId
- id of figure to checkp
- active Playerg
- game instance- Returns:
- true if figure is usable
-
setFigure
Set a figure on a field according- Parameters:
figId
- id of figure to checkdice
- Value of dice got from rolldice()p
- active Playerg
- game instance- Returns:
- 0 if no figure kicked. 1 if another figure was kicked
-