From a7cf6f25bedac44b78fdd10622f484b409c3d1c4 Mon Sep 17 00:00:00 2001 From: Jens <3007492@hs-mannheim.de> Date: Mon, 6 May 2024 16:33:54 +0200 Subject: [PATCH] test --- .DS_Store | Bin 0 -> 6148 bytes Facade/Game.java | 32 ++++++++++++++++++++++++++++++-- UI/Main.java | 14 ++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 .DS_Store create mode 100644 UI/Main.java diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..0108b601defa223f937a156327a8d757e6266f3f GIT binary patch literal 6148 zcmeH~O^ee&7{{OK*0!+-Jt*u&81P!wT2^%N5^Go3gCHAU4k|U-1Px|0OOx6|Ddeml z#;c#i@8U`S&&(_|sUG$sQs#kY{`2xYdHFRn(;*@;S;Y5<21L|@v$n6J_=E8{`UYk4oAQd_}>Wd-0jem6rEE@_4&(-!ejWsFKznKYq8O?xUh5m zdvuYdML8P%5UsuTwNAI|b^G0S!AG?W%CKA%lW_iqTQ8K#qRV<1y-JhiY;g05%F8g# zletbv;{+jZU#EGjmJ_we<3i^KX2A1$-fXbHT8$svAIkCJ!}Ue;*JUkk&*Iw_| zox6`tXP>h3Tz%0`O#CV$gJUMFMtC^!iuKbK#DFBe44fczuv?R^Mu6R4*MU^br8sMz=Q9d28exY1Ow{ z8N~=pm{h1q750cBOgj3djq|NmMol^id-xFc&cdEhguXkjFLgKx->54c0Y{)tV9zuM zy#F8n{rq1~axF)|5!fjLqCE|!6TFh$Ten`0_gV>m4`<`J%BW63VYg#l;jMTdt_@?7 XD^TBRWfVOy_eVfuaD^lAPYL`6B6r59 literal 0 HcmV?d00001 diff --git a/Facade/Game.java b/Facade/Game.java index 5fe6acd..4d205f6 100644 --- a/Facade/Game.java +++ b/Facade/Game.java @@ -10,7 +10,6 @@ public class Game { private int numberOfDice; private Dice dice = new Dice(numberOfDice); private int[] diceValues; - private Player player1; private Yatzy_Sheet sheet = new Yatzy_Sheet(); private Ones ones = new Ones(); @@ -30,11 +29,20 @@ public class Game { public void startgame(int playerCount, String[] name, int numberOfDice){ for(int i = 0; i < playerCount; i++){ - player1 = new Player(name[i], sheet, dice); + Player player1 = new Player(name[i], sheet, dice); players.add(player1); } } + // public void startgame(int playerCount, String[] name, int numberOfDice){ + // this.numberOfDice = numberOfDice; + // dice = new Dice(numberOfDice); + // for(int i = 0; i < playerCount; i++){ + // Player player = new Player(name[i], sheet, dice); + // players.add(player); + // } + // } + public int[] rollDice(Dice dice){ dice.rollDice(numberOfDice); int[] diceValues = dice.getValues(); @@ -119,4 +127,24 @@ public class Game { } return ""; } + + public String getCategoryNames(){ + String[] categorynames = new String[13]; + + categorynames[0] = "Ones"; + categorynames[1] = "Twos"; + categorynames[2] = "Threes"; + categorynames[3] = "Fours"; + categorynames[4] = "Fives"; + categorynames[5] = "Sixes"; + categorynames[6] = "Two Pairs"; + categorynames[7] = "Three Pairs"; + categorynames[8] = "Four Pairs"; + categorynames[9] = "Full House"; + categorynames[10] = "Straight Flush"; + categorynames[11] = "Royal Straight Flush"; + categorynames[12] = "Yatzy"; + + return categorynames.toString(); + } } diff --git a/UI/Main.java b/UI/Main.java new file mode 100644 index 0000000..3d26db3 --- /dev/null +++ b/UI/Main.java @@ -0,0 +1,14 @@ +package UI; + +import Facade.Game; + +public class Main { + public static void main(String[] args){ + Game game = new Game(); + String[] names = new String[2]; + names[0] = "Jens"; + names[1] = "mike"; + game.startgame(2,names , 6); + System.out.println(game.getPlayerName(0)); + } +}