main
Jens 2024-05-06 12:28:18 +02:00
parent 7e803d7a56
commit 2ce4931c19
3 changed files with 30 additions and 8 deletions

View File

@ -2,12 +2,10 @@ package Domain;
public class FourPairs extends Category{ public class FourPairs extends Category{
private Player player;
private int one = 0, two = 0, three = 0, four = 0, five = 0; private int one = 0, two = 0, three = 0, four = 0, five = 0;
public FourPairs(Player player) { public FourPairs(Player player) {
super("Four Pairs", "Four times the same dice"); super("Four Pairs", "Four times the same dice");
this.player = player;
} }
@Override @Override

View File

@ -2,6 +2,11 @@ package Domain;
public class Yatzy_Sheet { public class Yatzy_Sheet {
private int[] tabelle; private int[] tabelle;
public Yatzy_Sheet(){
}
//counts all the //counts all the
public int getSumOne(){ public int getSumOne(){
int sum = 0; int sum = 0;

View File

@ -2,16 +2,16 @@ package Facade;
import java.util.ArrayList; import java.util.ArrayList;
import Domain.Dice;
import Domain.Player; import Domain.Player;
import Domain.Yatzy_Sheet;
public class Game { public class Game {
ArrayList<Player> player = new ArrayList<>(); private ArrayList<Player> player = new ArrayList<>();
private int numberOfDice;
private Dice dice = new Dice(numberOfDice);
public int rollDice(){ private int[] diceValues;
return 0;
}
public ArrayList<Player> newPlayer(int playerCount, String name){ public ArrayList<Player> newPlayer(int playerCount, String name){
@ -26,4 +26,23 @@ public class Game {
Player secondPlayer = player.get(1); Player secondPlayer = player.get(1);
return secondPlayer.getSheet(); 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){
}
} }