Yatzy/Facade/Game.java

49 lines
1.1 KiB
Java

package Facade;
import java.util.ArrayList;
import Domain.Dice;
import Domain.Player;
import Domain.Yatzy_Sheet;
public class Game {
private ArrayList<Player> player = new ArrayList<>();
private int numberOfDice;
private Dice dice = new Dice(numberOfDice);
private int[] diceValues;
public ArrayList<Player> newPlayer(int playerCount, String name){
for(int i = 0; i < playerCount; i++){
Player p1 = new Player(name, null);
player.add(p1);
}
return player;
}
public int showScore(){
Player secondPlayer = player.get(1);
return secondPlayer.getSheet();
}
public void startgame(int playerCount, String[] name, int numberOfDice){
for(int i = 0; i < playerCount; i++){
Yatzy_Sheet sheet = new Yatzy_Sheet();
Player player1 = new Player(name[i], sheet, dice);
player.add(player1);
}
}
public int[] rollDice(Dice dice){
dice.rollDice(numberOfDice);
int[] diceValues = dice.getValues();
return diceValues;
}
public void choosCategory(int diceValues){
}
}