From 82a53c41205da6292584a294394b879826afa020 Mon Sep 17 00:00:00 2001 From: Jens <3007492@hs-mannheim.de> Date: Thu, 2 May 2024 12:46:36 +0200 Subject: [PATCH] dfsg --- Domain/Dice.java | 4 ++-- Domain/Player.java | 8 ++++++-- Facade/Game.java | 21 +++++++++++++++++++++ 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 Facade/Game.java diff --git a/Domain/Dice.java b/Domain/Dice.java index 9690073..2edb141 100644 --- a/Domain/Dice.java +++ b/Domain/Dice.java @@ -9,10 +9,10 @@ public class Dice { this.numberOfDice = numberOfDice; } - public int rand(int numberOfDice){ + public int rollDice(int numberOfDice){ Random random = new Random(); numberOfDice = random.nextInt(6); - return numberOfDice; + return numberOfDice + 1; } public int getAugenzahl(){ diff --git a/Domain/Player.java b/Domain/Player.java index 7eb9d8c..194a434 100644 --- a/Domain/Player.java +++ b/Domain/Player.java @@ -7,7 +7,7 @@ public class Player { public Player(String name){ this.name = name; - tabelle = new int[17]; + this.tabelle = new int[17]; } //counts all the @@ -21,7 +21,7 @@ public class Player { public int getSumTwo(){ int sum = 0; - for (int i = 7; i < 7; i++){ + for (int i = 7; i < 17; i++){ sum += tabelle[i]; } return sum; @@ -33,6 +33,10 @@ public class Player { return sumOne += sumTwo; } + public String toString(){ + for (int i = 0; i < ) + } + public String getName(){ return name; } diff --git a/Facade/Game.java b/Facade/Game.java new file mode 100644 index 0000000..7e0c49f --- /dev/null +++ b/Facade/Game.java @@ -0,0 +1,21 @@ +package Facade; + +import java.util.ArrayList; + +import Domain.Player; + +public class Game { + + ArrayList player = new ArrayList<>(); + + + public int rollDice(){ + return 0; + } + + public Player newPlayer(){ + Player p1 = new Player("Jens"); + player.add(p1); + return p1; + } +}