main
Jens 2024-05-02 12:46:36 +02:00
parent e40542a831
commit 82a53c4120
3 changed files with 29 additions and 4 deletions

View File

@ -9,10 +9,10 @@ public class Dice {
this.numberOfDice = numberOfDice; this.numberOfDice = numberOfDice;
} }
public int rand(int numberOfDice){ public int rollDice(int numberOfDice){
Random random = new Random(); Random random = new Random();
numberOfDice = random.nextInt(6); numberOfDice = random.nextInt(6);
return numberOfDice; return numberOfDice + 1;
} }
public int getAugenzahl(){ public int getAugenzahl(){

View File

@ -7,7 +7,7 @@ public class Player {
public Player(String name){ public Player(String name){
this.name = name; this.name = name;
tabelle = new int[17]; this.tabelle = new int[17];
} }
//counts all the //counts all the
@ -21,7 +21,7 @@ public class Player {
public int getSumTwo(){ public int getSumTwo(){
int sum = 0; int sum = 0;
for (int i = 7; i < 7; i++){ for (int i = 7; i < 17; i++){
sum += tabelle[i]; sum += tabelle[i];
} }
return sum; return sum;
@ -33,6 +33,10 @@ public class Player {
return sumOne += sumTwo; return sumOne += sumTwo;
} }
public String toString(){
for (int i = 0; i < )
}
public String getName(){ public String getName(){
return name; return name;
} }

21
Facade/Game.java 100644
View File

@ -0,0 +1,21 @@
package Facade;
import java.util.ArrayList;
import Domain.Player;
public class Game {
ArrayList<Player> player = new ArrayList<>();
public int rollDice(){
return 0;
}
public Player newPlayer(){
Player p1 = new Player("Jens");
player.add(p1);
return p1;
}
}