diff --git a/Domain/FourPairs.java b/Domain/FourPairs.java index a373d23..15a536d 100644 --- a/Domain/FourPairs.java +++ b/Domain/FourPairs.java @@ -2,12 +2,10 @@ package Domain; public class FourPairs extends Category{ - private Player player; private int one = 0, two = 0, three = 0, four = 0, five = 0; public FourPairs(Player player) { super("Four Pairs", "Four times the same dice"); - this.player = player; } @Override diff --git a/Domain/Yatzy_Sheet.java b/Domain/Yatzy_Sheet.java index ccf27b7..e9bd9fd 100644 --- a/Domain/Yatzy_Sheet.java +++ b/Domain/Yatzy_Sheet.java @@ -2,6 +2,11 @@ package Domain; public class Yatzy_Sheet { private int[] tabelle; + + public Yatzy_Sheet(){ + + } + //counts all the public int getSumOne(){ int sum = 0; diff --git a/Facade/Game.java b/Facade/Game.java index 571b88b..ded5915 100644 --- a/Facade/Game.java +++ b/Facade/Game.java @@ -2,16 +2,16 @@ package Facade; import java.util.ArrayList; +import Domain.Dice; import Domain.Player; +import Domain.Yatzy_Sheet; public class Game { - ArrayList player = new ArrayList<>(); - - - public int rollDice(){ - return 0; - } + private ArrayList player = new ArrayList<>(); + private int numberOfDice; + private Dice dice = new Dice(numberOfDice); + private int[] diceValues; public ArrayList newPlayer(int playerCount, String name){ @@ -26,4 +26,23 @@ public class Game { 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){ + + } }