From 9c3c0a7f899488041085a02fb34b25910fdc57b1 Mon Sep 17 00:00:00 2001 From: selim Date: Tue, 30 Apr 2024 15:49:59 +0200 Subject: [PATCH] 2 seperate highscore tables and final fixes --- bin/csv/highscores.csv | 20 +++---- bin/csv/highscoresSpecial8.csv | 0 bin/domain/Box.class | Bin 12960 -> 13120 bytes bin/domain/Dice.class | Bin 1018 -> 1018 bytes bin/domain/Hand.class | Bin 2926 -> 2926 bytes bin/domain/Player.class | Bin 705 -> 705 bytes bin/facade/YahtzeeGame.class | Bin 10829 -> 11595 bytes bin/ui/TUI$1.class | Bin 373 -> 373 bytes bin/ui/TUI.class | Bin 4938 -> 5414 bytes src/csv/highscores.csv | 20 +++---- src/csv/highscoresSpecial8.csv | 0 src/domain/Box.java | 85 +++++++++++++++++------------- src/facade/YahtzeeGame.java | 92 +++++++++++++++++++++++++-------- src/ui/TUI.java | 42 +++++++++------ 14 files changed, 167 insertions(+), 92 deletions(-) create mode 100644 bin/csv/highscoresSpecial8.csv create mode 100644 src/csv/highscoresSpecial8.csv diff --git a/bin/csv/highscores.csv b/bin/csv/highscores.csv index e361fb1..d458538 100644 --- a/bin/csv/highscores.csv +++ b/bin/csv/highscores.csv @@ -1,10 +1,10 @@ -2024-04-30: Selim: 172 -___: ___: 0 -___: ___: 0 -___: ___: 0 -___: ___: 0 -___: ___: 0 -___: ___: 0 -___: ___: 0 -___: ___: 0 -___: ___: 0 +2024-04-30 Selim 254 +2024-04-30 Enes 127 +2024-04-30 David 82 +___ ___ 0 +___ ___ 0 +___ ___ 0 +___ ___ 0 +___ ___ 0 +___ ___ 0 +___ ___ 0 diff --git a/bin/csv/highscoresSpecial8.csv b/bin/csv/highscoresSpecial8.csv new file mode 100644 index 0000000..e69de29 diff --git a/bin/domain/Box.class b/bin/domain/Box.class index f5e47dedf965c093575e3ba32fc1801f94e4ae37..3a59645927e1d3953d17f19fc4e3a0685cf14e37 100644 GIT binary patch delta 5030 zcmcIoX>?RY7QWxh)^s`{=>(dv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Ugc$*&19FUL9`-I|ovrc7eLI3zVZ>pbG5*#b+0&IlI8q9bVnUkj&Am<8jcd z`(GoMsnz|5p>@0_{_8UT$Ys99WuD|RU*j@Qa+z;&nQ!wQ@RoGq9m`id00C=OahA#B zs=h*RqE7`J*6;eF|a54uyLNOt%8g+Ib=9msrIwiU1cSxHF8vc3KTSbhjK zBGH3mzlc7TSbW06^Qj)udb@Z)jQS^ld-z~CzGU5363DA&q-9KB94-#tx19H9n^CpvJ=*|NHdqOLU_j WGo^E~BY1+_>E;$5!&7)hvi}LUdvsO+ diff --git a/bin/domain/Dice.class b/bin/domain/Dice.class index e5e2cff13a950f3f5169f94117f9520baf4d2816..84b2350dc99c536e3eb11af40257810e712a7dac 100644 GIT binary patch delta 17 Zcmeyx{)?UC)W2Q(7#J9AH*$Pp1^`IY2Q~lz delta 17 Zcmeyx{)?UC)W2Q(7#J8FH*$Pp1^`Is2RZ-% diff --git a/bin/domain/Hand.class b/bin/domain/Hand.class index e8f03e99396fc3b41b43620fccddc69b169261a7..986e04a5714b5814169d9f3e0a42351c33eaf03a 100644 GIT binary patch delta 17 ZcmaDS_D+oB)W2Q(7#J9AH*%zL0{}<`2DktK delta 17 ZcmaDS_D+oB)W2Q(7#J8FH*%zL0{}=F2D|_O diff --git a/bin/domain/Player.class b/bin/domain/Player.class index dc8b686b87f79694c69b1fb7ad659e3949d6b96b..e97c8034e7633a7df7a7201685418f157a34f967 100644 GIT binary patch delta 17 ZcmX@edXSal)W2Q(7#J9AH*)M`0suh-28I9t delta 17 ZcmX@edXSal)W2Q(7#J8FH*)M`0sui628sXx diff --git a/bin/facade/YahtzeeGame.class b/bin/facade/YahtzeeGame.class index ced5c5aab5f68190b6021e7b8c174835eeaee0b0..3ce2371685a6266bf1164109931634b0bbb4480c 100644 GIT binary patch delta 5150 zcmb_g3s}`vwqL*h^KkrwaNvM&L=Ir`I>;k@f;y&_lqiZ~DrpEuAQ8BLrZv;a8Jla} zTQk${sySBL%t&>;KEgr8@=@B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^D>F2`Hh`KPh}EQ^&jvx*r8s zpvN54fu0|OaEwEviOcQTG3lCK%+_h1$X4>@?1-1x!?yX2G?G^Rl*7bw{WsYwDV%m# zc6+GMqm&-M^bD`>_eL)rP*h3$D21P-^IXexKUH)|{7g~*l5JqT@)h~AQ-)|=Q zeRaVAs2dyPxLKK4joIkL99Wo(&6tM>=JP9X6?Wok+{yheEZ_xu7q3k*9>FzyvzA~V zN^uZXd=W0hB(7z>uER;x;AJf0f){g1*W)$R;?H;w{(&W!!ZPxpj{LZR3b+rTfr`;c zrD#e}HJYiGALga}9=D>E)}oDUv{OG;(;zx%7;EVPtfR-Vo+hw?p2kKxicNG3UGxI? zCvYphgxlyeEINa3I*T4UhhEJuR=c6cpYyj zRki2wd;EcKpIjdKNBjvI=4%hL27iHzJaiau@;Eo&RPVr9jKD(`bPLWVl!>>P;5y`A z#7rNS`A|58dwpmyE~49qzmoqv@~1e!UvU9VH_XbvfKKf^^mDudZv2fyHT<1*1}i=d z=edFlPJ7X5FRPZwX= 108){ + if (nullCheckInt(setCategoryOne) + nullCheckInt(setCategoryTwo) + nullCheckInt(setCategoryThree) + + nullCheckInt(setCategoryFour) + + nullCheckInt(setCategoryFive) + nullCheckInt(setCategorySix) + nullCheckInt(setCategorySeven) + + nullCheckInt(setCategoryEight) >= 108) { this.bonus = 35; } } else - - if(nullCheckInt(setCategoryOne) + nullCheckInt(setCategoryTwo) + nullCheckInt(setCategoryThree) + nullCheckInt(setCategoryFour) - + nullCheckInt(setCategoryFive) + nullCheckInt(setCategorySix) >= 63){ - this.bonus = 35; + + if (nullCheckInt(setCategoryOne) + nullCheckInt(setCategoryTwo) + nullCheckInt(setCategoryThree) + + nullCheckInt(setCategoryFour) + + nullCheckInt(setCategoryFive) + nullCheckInt(setCategorySix) >= 63) { + this.bonus = 35; } } @@ -381,7 +391,8 @@ public class Box { if (savedGamemode.equals("Special8")) return setCategoryOne + setCategoryTwo + setCategoryThree + setCategoryFour + setCategoryFive - + setCategorySix + setCategorySeven + setCategoryEight + nullCheckInt(bonus) + setCategoryTripleMatch + + setCategorySix + setCategorySeven + setCategoryEight + nullCheckInt(bonus) + + setCategoryTripleMatch + setCategoryFourOfAKind + setCategoryFullHouse + setCategorySmallStreet + setCategoryBigStreet + setCategoryYahtzee + setCategoryChance + setCategoryStarWarsDay @@ -451,45 +462,47 @@ public class Box { } - public void updateUpperBoxScore(){ + public void updateUpperBoxScore() { - if(savedGamemode.equals("Special8")) + if (savedGamemode.equals("Special8")) - this.upperBoxScore = nullCheckInt(setCategoryOne) + nullCheckInt(setCategoryTwo) + nullCheckInt(setCategoryThree) + nullCheckInt(setCategoryFour) - + nullCheckInt(setCategoryFive) + nullCheckInt(setCategorySix) + nullCheckInt(setCategorySeven) + nullCheckInt(setCategoryEight) + nullCheckInt(bonus); - - + this.upperBoxScore = nullCheckInt(setCategoryOne) + nullCheckInt(setCategoryTwo) + + nullCheckInt(setCategoryThree) + nullCheckInt(setCategoryFour) + + nullCheckInt(setCategoryFive) + nullCheckInt(setCategorySix) + nullCheckInt(setCategorySeven) + + nullCheckInt(setCategoryEight) + nullCheckInt(bonus); else - - this.upperBoxScore = nullCheckInt(setCategoryOne) + nullCheckInt(setCategoryTwo) + nullCheckInt(setCategoryThree) + nullCheckInt(setCategoryFour) - + nullCheckInt(setCategoryFive) + nullCheckInt(setCategorySix) + nullCheckInt(bonus); - - + + this.upperBoxScore = nullCheckInt(setCategoryOne) + nullCheckInt(setCategoryTwo) + + nullCheckInt(setCategoryThree) + nullCheckInt(setCategoryFour) + + nullCheckInt(setCategoryFive) + nullCheckInt(setCategorySix) + nullCheckInt(bonus); } - public void updateLowerBoxScore(){ + public void updateLowerBoxScore() { - if(savedGamemode.equals("Special8")) + if (savedGamemode.equals("Special8")) - this.lowerBoxScore = nullCheckInt(setCategoryTripleMatch) + nullCheckInt(setCategoryFourOfAKind) + nullCheckInt(setCategoryFullHouse) + nullCheckInt(setCategorySmallStreet) - + nullCheckInt(setCategoryBigStreet) + nullCheckInt(setCategoryYahtzee) + nullCheckInt(setCategoryChance) + nullCheckInt(setCategoryStarWarsDay) + nullCheckInt(setCategoryR2D2); - - + this.lowerBoxScore = nullCheckInt(setCategoryTripleMatch) + nullCheckInt(setCategoryFourOfAKind) + + nullCheckInt(setCategoryFullHouse) + nullCheckInt(setCategorySmallStreet) + + nullCheckInt(setCategoryBigStreet) + nullCheckInt(setCategoryYahtzee) + + nullCheckInt(setCategoryChance) + nullCheckInt(setCategoryStarWarsDay) + + nullCheckInt(setCategoryR2D2); else - - this.lowerBoxScore = nullCheckInt(setCategoryTripleMatch) + nullCheckInt(setCategoryFourOfAKind) + nullCheckInt(setCategoryFullHouse) + nullCheckInt(setCategorySmallStreet) - + nullCheckInt(setCategoryBigStreet) + nullCheckInt(setCategoryYahtzee) + nullCheckInt(setCategoryChance) + nullCheckInt(setCategoryStarWarsDay); + + this.lowerBoxScore = nullCheckInt(setCategoryTripleMatch) + nullCheckInt(setCategoryFourOfAKind) + + nullCheckInt(setCategoryFullHouse) + nullCheckInt(setCategorySmallStreet) + + nullCheckInt(setCategoryBigStreet) + nullCheckInt(setCategoryYahtzee) + + nullCheckInt(setCategoryChance) + nullCheckInt(setCategoryStarWarsDay); } - - public void updateTotalScore(){ + + public void updateTotalScore() { this.totalScore = nullCheckInt(upperBoxScore) + nullCheckInt(lowerBoxScore); } - + public String nullCheck(Integer i) { if (i == null) @@ -500,7 +513,7 @@ public class Box { public int nullCheckInt(Integer i) { - if(i == null) + if (i == null) return 0; else return i; diff --git a/src/facade/YahtzeeGame.java b/src/facade/YahtzeeGame.java index 786e8c1..92194b8 100644 --- a/src/facade/YahtzeeGame.java +++ b/src/facade/YahtzeeGame.java @@ -68,6 +68,11 @@ public class YahtzeeGame { } + public int getLockedInDiceAmount(int player) { + + return players.get(player).hand.getLockedInDiceAmount(); + } + public void lockInDices(int player, String... dices) { if (dices[0].equals("none")) @@ -138,6 +143,12 @@ public class YahtzeeGame { } + public boolean onlyOneOption(int player) { + + return players.get(player).box.onlyOneOption(); + + } + public String selectedOptionsPrinted(int player) { return players.get(player).box.selectedOptionsPrinted(player); @@ -172,26 +183,48 @@ public class YahtzeeGame { String highscores[][] = new String[10][3]; Scanner sc = new Scanner(new File("src/csv/highscores.csv")); + Scanner scSp = new Scanner(new File("src/csv/highscoresSpecial8.csv")); String mem[] = new String[3]; - for (int i = 0; i < 10; i++) { + if (savedGamemode.equals("Special8")) - if (sc.hasNextLine()) { + for (int i = 0; i < 10; i++) { - mem = sc.nextLine().split(" "); - highscores[i][0] = mem[0]; - highscores[i][1] = mem[1]; - highscores[i][2] = mem[2]; + if (scSp.hasNextLine()) { + + mem = scSp.nextLine().split(" "); + highscores[i][0] = mem[0]; + highscores[i][1] = mem[1]; + highscores[i][2] = mem[2]; + + } else { + highscores[i][0] = "___"; + highscores[i][1] = "___"; + highscores[i][2] = "0"; + } + + } + else + + for (int i = 0; i < 10; i++) { + + if (sc.hasNextLine()) { + + mem = sc.nextLine().split(" "); + highscores[i][0] = mem[0]; + highscores[i][1] = mem[1]; + highscores[i][2] = mem[2]; + + } else { + highscores[i][0] = "___"; + highscores[i][1] = "___"; + highscores[i][2] = "0"; + } - } else { - highscores[i][0] = "___"; - highscores[i][1] = "___"; - highscores[i][2] = "0"; } - } - sc.close(); + scSp.close(); return highscores; } @@ -405,16 +438,27 @@ public class YahtzeeGame { } PrintWriter out = new PrintWriter(new FileWriter("src/csv/highscores.csv", false)); + PrintWriter outSp = new PrintWriter(new FileWriter("src/csv/highscoresSpecial8.csv", false)); - for (int i = 0; i < 10; i++) { + if (savedGamemode.equals("Special8")) + for (int i = 0; i < 10; i++) { - out.print(highscores[i][0] + ": " + highscores[i][1] + ": " - + highscores[i][2]); + outSp.print(highscores[i][0] + " " + highscores[i][1] + " " + + highscores[i][2]); - out.println(); - } + outSp.println(); + } + else + for (int i = 0; i < 10; i++) { + + out.print(highscores[i][0] + " " + highscores[i][1] + " " + + highscores[i][2]); + + out.println(); + } out.close(); + outSp.close(); } catch (Exception e) { } @@ -428,15 +472,16 @@ public class YahtzeeGame { } - public String showHighscores() throws FileNotFoundException { + public String showHighscores(String gamemode) throws FileNotFoundException { StringBuilder sb = new StringBuilder(); + this.savedGamemode = gamemode; for (int i = 0; i < 10; i++) { sb.append((i + 1) + ": " + refreshHighscoreList()[i][0]); - sb.append(" " + refreshHighscoreList()[i][1]); - sb.append(" " + refreshHighscoreList()[i][2] + "\n"); + sb.append(": " + refreshHighscoreList()[i][1]); + sb.append(": " + refreshHighscoreList()[i][2] + "\n"); } @@ -447,10 +492,15 @@ public class YahtzeeGame { public void deleteHighscores() throws IOException { PrintWriter out = new PrintWriter(new FileWriter("src/csv/highscores.csv", false)); + PrintWriter outSp = new PrintWriter(new FileWriter("src/csv/highscoresSpecial8.csv", false)); - out.print(""); + if (savedGamemode.equals("Special8")) + outSp.print(""); + else + out.print(""); out.close(); + outSp.close(); } diff --git a/src/ui/TUI.java b/src/ui/TUI.java index b0ba1c0..5ba0c66 100644 --- a/src/ui/TUI.java +++ b/src/ui/TUI.java @@ -17,14 +17,17 @@ public class TUI { YahtzeeGame game = new YahtzeeGame() { }; - System.out.println("\nMain menu:\n"); + System.out.println("\nMain menu:"); System.out.println(">Play"); System.out.println(">Highscores"); choice = sc.nextLine(); if (choice.equals("Highscores")) { - System.out.println(game.showHighscores()); - System.out.println(">Return"); + System.out.println("\nChoose your gamemode:"); + System.out.println(">Normal"); + System.out.println(">Special8"); + System.out.println("\n" + game.showHighscores(sc.nextLine())); + System.out.println("\n>Return"); System.out.println(">Delete"); choice = sc.nextLine(); if (choice.equals("Return")) { @@ -72,20 +75,24 @@ public class TUI { if (game.gameOver(i)) continue; - System.out.println("\nIts your turn " + game.getPlayerName(i)); + System.out.println("\n\n\nIts your turn " + game.getPlayerName(i)); System.out.println("\nThis is your Yahtzee Box: "); System.out.println("\n" + game.selectedOptionsPrinted(i) + "\n"); while (!game.allDicesLockedIn(i) && !game.noMoreRolls(i)) { - System.out.println("Rolling dices... "); + if (game.getLockedInDiceAmount(i) != 4) + System.out.println("Rolling dices... "); + else + System.out.println("Rolling the last dice..."); + game.rollDices(i); System.out.println("Free dices: " + game.getFreeDiceNumbers(i)); System.out.println("Locked in dices: " + game.getLockedInDiceNumbers(i)); - if(game.autoLockInDices(i)){ - System.out.println("\nNo rolls left auto locking dices....\n"); + if (game.autoLockInDices(i)) { + System.out.println("\nNo rolls left => auto locking dices...\n"); } if (!game.noMoreRolls(i)) { System.out.println( @@ -94,9 +101,9 @@ public class TUI { game.lockInDices(i, choice.split(" ")); - if ((game.getLeftRolls(i)) != 1) + if ((game.getLeftRolls(i)) != 1 && !game.allDicesLockedIn(i)) System.out.println("\n" + game.getLeftRolls(i) + " rolls left"); - else if ((game.getLeftRolls(i)) == 1) + else if ((game.getLeftRolls(i)) == 1 && !game.allDicesLockedIn(i)) System.out.println("\n" + game.getLeftRolls(i) + " roll left"); } } @@ -104,22 +111,27 @@ public class TUI { System.out.println("\n\nLocked in dices: " + game.getLockedInDiceNumbers(i)); System.out.println("Done locking in... Here are your options: "); game.evaluateAllOptions(i); - System.out.println(game.optionsPrinted(i)); - System.out.println("Which option you want to select?: "); - game.selectOption(i, sc.nextLine()); + System.out.println("\n" + game.optionsPrinted(i)); + if (game.onlyOneOption(i)) { + game.selectOption(i, game.getAllOptions(i).get(0).split(":")[0]); + System.out.println("Only one option possible => auto selecting option..."); + } else { + System.out.println("Which option you want to select?: "); + game.selectOption(i, sc.nextLine()); + } if (game.gameOver(i)) { System.out.println( - "Your game is over, here is your total score: " + game.returnTotalPoints(i)); + "\n\nYour game is over, here is your total score: " + game.returnTotalPoints(i)); } } } - System.out.println("The game is over, " + game.getWinnerMessage()); + System.out.println("\n\nThe game is over, " + game.getWinnerMessage()); System.out.println("Saving all highscores to the highscore table..."); game.saveAllPlayersHighscores(); System.out.println( - "If you want to stop the programm type: 'stop', otherwise you will return to the main menu:"); + "\nIf you want to stop the programm type: 'stop', otherwise you will return to the main menu:"); choice = sc.nextLine(); } }