From e40542a831bd05f56442ff631b3cf995c626a874 Mon Sep 17 00:00:00 2001 From: Jens <3007492@hs-mannheim.de> Date: Thu, 2 May 2024 11:26:21 +0200 Subject: [PATCH] test test test --- Domain/Dice.java | 21 +++++++++++++++++++++ Domain/Player.java | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 Domain/Dice.java create mode 100644 Domain/Player.java diff --git a/Domain/Dice.java b/Domain/Dice.java new file mode 100644 index 0000000..9690073 --- /dev/null +++ b/Domain/Dice.java @@ -0,0 +1,21 @@ +package Domain; + +import java.util.Random; + +public class Dice { + private int numberOfDice; + + public Dice(int numberOfDice){ + this.numberOfDice = numberOfDice; + } + + public int rand(int numberOfDice){ + Random random = new Random(); + numberOfDice = random.nextInt(6); + return numberOfDice; + } + + public int getAugenzahl(){ + return numberOfDice; + } +} diff --git a/Domain/Player.java b/Domain/Player.java new file mode 100644 index 0000000..7eb9d8c --- /dev/null +++ b/Domain/Player.java @@ -0,0 +1,39 @@ +package Domain; + +public class Player { + + private String name; + private int[] tabelle; + + public Player(String name){ + this.name = name; + tabelle = new int[17]; + } + + //counts all the + public int getSumOne(){ + int sum = 0; + for(int i = 0; i < 6; i++){ + sum += tabelle[i]; + } + return sum; + } + + public int getSumTwo(){ + int sum = 0; + for (int i = 7; i < 7; i++){ + sum += tabelle[i]; + } + return sum; + } + + public int getSum(){ + int sumOne = getSumOne(); + int sumTwo = getSumTwo(); + return sumOne += sumTwo; + } + + public String getName(){ + return name; + } +}