Yatzy/Facade/Game.java

49 lines
1.1 KiB
Java
Raw Normal View History

2024-05-02 12:46:36 +02:00
package Facade;
import java.util.ArrayList;
2024-05-06 12:28:18 +02:00
import Domain.Dice;
2024-05-02 12:46:36 +02:00
import Domain.Player;
2024-05-06 12:28:18 +02:00
import Domain.Yatzy_Sheet;
2024-05-02 12:46:36 +02:00
public class Game {
2024-05-06 12:28:18 +02:00
private ArrayList<Player> player = new ArrayList<>();
private int numberOfDice;
private Dice dice = new Dice(numberOfDice);
private int[] diceValues;
2024-05-02 12:46:36 +02:00
2024-05-03 12:22:01 +02:00
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();
2024-05-02 12:46:36 +02:00
}
2024-05-06 12:28:18 +02:00
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){
}
2024-05-02 12:46:36 +02:00
}