From df415b40424f9f6bb106253ab26f6e30839aff15 Mon Sep 17 00:00:00 2001 From: selim Date: Mon, 29 Apr 2024 16:47:41 +0200 Subject: [PATCH] Nearly everything implemented --- bin/csv/highscores.csv | 1 + bin/domain/Box.class | Bin 10484 -> 10705 bytes bin/domain/Hand.class | Bin 2512 -> 2715 bytes bin/facade/YahtzeeGame.class | Bin 9853 -> 10400 bytes bin/ui/TUI$1.class | Bin 0 -> 373 bytes bin/ui/TUI.class | Bin 548 -> 4622 bytes src/csv/highscores.csv | 1 + src/domain/Hand.java | 8 +- src/facade/YahtzeeGame.java | 13 ++- src/ui/TUI.java | 149 +++++++++++++++++------------------ 10 files changed, 90 insertions(+), 82 deletions(-) create mode 100644 bin/ui/TUI$1.class diff --git a/bin/csv/highscores.csv b/bin/csv/highscores.csv index e69de29..8b13789 100644 --- a/bin/csv/highscores.csv +++ b/bin/csv/highscores.csv @@ -0,0 +1 @@ + diff --git a/bin/domain/Box.class b/bin/domain/Box.class index 29b6b8bebafe77d6d05096955b149e4048ddfa83..b233fb26b188aee417864ddfd91948128af0bbb0 100644 GIT binary patch delta 2270 zcmb`IU2Icj7{{M~JGbtv>!97r#^>Z??5i8w_!#>T++c3V*BFYE$*AMdZgeel-53lx zpfOxvh2uS=mdx;lecewdeOf z@AIDb-?yjty6^ND-=$}65K$}6Ts4xpouI$G^nf0Ma^s`1SbNkQI09N-zI`Y>7Ostj zs{p^`w%6@kq0uN-6E7^Yo8>EjN@6FI;fjzvi}%D50}ys!|pbM_CX`dG7LYJtFa1&N`)$gYK4$OjY6%$8ihKAdW8mswF>JL)+=mK zXjIs!(4^3;&_Zd0?qh`)E3pdXNhM?__RmIJ(1S{lyT8BRpl?y_r8a~>W%ll@Li>Z< zLU${r?ee@(b_3SsV6DABuPS>z=>78Tc7MTA`?I`>>Us}0f_wvE&MT2Tu`6yimBNE& z&Fwv&5Z7vVdyA?zfeJF!9f{GT3_YvM!7-;tyZw$g5ZVfwm#ObD$IQ4)cuuoh2P4sx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G6w2Wym*V$X8qK2tWQ_Wb{eSo^SD44EZ(hwD8_Tf-vAVcO3DBL diff --git a/bin/ui/TUI$1.class b/bin/ui/TUI$1.class new file mode 100644 index 0000000000000000000000000000000000000000..7ce44c2558e1266e868e9528d7d098e312a868c3 GIT binary patch literal 373 zcmXv~Jx{|h5PeQV6GEUgKw)HHC=5i*1(u4BN})?jCB)<=rZGxvDRCJ1S4>C@`~ZFw z;@pEr0+!h_2Yz3`N0B7Wkzc^Bf2mx7^vDU~$W z46Xj@jKLl1Oay3QGsFhk44p(OF>cDasHS{gkRnQS%8MDVq~+_PYjRmL1j+xz0g;Jr zs#M%ctMbXm`73|p)bd89g|4MqJP4EP%tJ&zR>BbbI3OD(mx`g+e@?6>F1T966H}39 zU~PsYr9?F>cwGw`>yJfk?saW&4BCW#0EDm`5PFowgv-j=C;Sg8I0z`(YaqfF#c=h2 daGRKm9f}S**j=(N_Rym&ST~{+hjbit{{U7}M#%sG literal 0 HcmV?d00001 diff --git a/bin/ui/TUI.class b/bin/ui/TUI.class index 0e5cba46bc2ca2acb771d78ad3430e5e63168d91..5fa08a11546b21d4cd320280f405d04376b633cf 100644 GIT binary patch literal 4622 zcmb7I3wRt=75?vL)17RlZMrmV!^ZWO%v>`4|QA1Dfl53rO{&$+X^O-(+(&wTmj&fIhF zdH&~|d-vg&rXK)sfvAijA}}v+wGM7e#t;>#*=0_ct+wfmw)XGbCDQ?s*IAAgbO=;5 zG;SA&cDWfDM+K^MRAQdM!j$F6P5JCj=?$7YZ7GmQxoOkhZh97f7bl~^nB@y-sZd%w zamt#OBe105lGHJ&1A%8bqwOpyzHv`l<^s!g{1_4fC#Y4H+nVezQ#33VKnzO+7AbN* zuwCOm~tHLsz7(?B0W(`dGfz0YS2`39gSb^G5JTrE3`G7Q#X0|oxKu)GD(_S7& zJsM+Zm|^6M?K;jxlRzxT9BtOPsE>+M*<&%RBL9Z&U9mcjW>jf7OQ5=s{A^^UlW&V_ zI9s5yW3z2eYB-l@9lh4*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<74zxGf!|{im14Dsgm3r*?LP|(j-W1vburYwi0fk55I=&^82%`#U%;Xl zX?=C`VT>NemdFdx4v~MOc!Kst@F(&l=w2VgGbH_Q>iKu|{HJ<8r=I^-&llA5MZ82i X_#}K(2vI??Zl-Vg6H$6_t!n-cmaO!= delta 241 zcmeBES;E3~>ff$?3=9mm3^EhB4%V|Xh%hqnXC;;;>gOcprR%#E73CLkFo-cS getLockedInDiceNumbers() { ArrayList res = new ArrayList<>(); - for (int i = 0; i < this.lockedInDices.size(); i++) { + for (int i = 0; i < getLockedInDiceAmount(); i++) { res.add(this.lockedInDices.get(i).getDiceNumber()); diff --git a/src/facade/YahtzeeGame.java b/src/facade/YahtzeeGame.java index af2dde1..3278e7f 100644 --- a/src/facade/YahtzeeGame.java +++ b/src/facade/YahtzeeGame.java @@ -1,5 +1,7 @@ package facade; +import java.io.File; +import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; @@ -151,10 +153,10 @@ public class YahtzeeGame { return 0; } - private String[][] refreshHighscoreList() { + private String[][] refreshHighscoreList() throws FileNotFoundException { String highscores[][] = new String[10][3]; - Scanner sc = new Scanner("src/csv/highscores.csv"); + Scanner sc = new Scanner(new File("src/csv/highscores.csv")); for (int i = 0; i < 10; i++) { @@ -162,7 +164,12 @@ public class YahtzeeGame { highscores[i][0] = sc.next(); highscores[i][1] = sc.next(); highscores[i][2] = sc.nextLine(); + } else { + highscores[i][0] = "___"; + highscores[i][1] = "___"; + highscores[i][2] = "0"; } + } sc.close(); @@ -402,7 +409,7 @@ public class YahtzeeGame { } - public String showHighscores() { + public String showHighscores() throws FileNotFoundException { StringBuilder sb = new StringBuilder(); diff --git a/src/ui/TUI.java b/src/ui/TUI.java index f8f7a69..863d494 100644 --- a/src/ui/TUI.java +++ b/src/ui/TUI.java @@ -1,9 +1,7 @@ package ui; import java.io.IOException; -import java.util.ArrayList; import java.util.Scanner; - import facade.YahtzeeGame; public class TUI { @@ -12,107 +10,106 @@ public class TUI { String choice = ""; Scanner sc = new Scanner(System.in); - boolean newGame = false; System.out.println("Yahtzee Star Wars Special!"); - while (newGame) { + while (!choice.equals("stop")) { + YahtzeeGame game = new YahtzeeGame() { }; + System.out.println("Main menu:\n"); + System.out.println(">Play"); + System.out.println(">Highscores"); + choice = sc.nextLine(); - while (!choice.equals("stop")) { - - System.out.println("Main menu:\n"); - System.out.println(">Play"); - System.out.println(">Highscores"); + if (choice.equals("Highscores")) { + System.out.println(game.showHighscores()); + System.out.println(">Return"); + System.out.println(">Delete"); choice = sc.nextLine(); + if (choice.equals("Return")) { + } - if (choice.equals("Highscores")) { - System.out.println(game.showHighscores()); - System.out.println(">Return"); - System.out.println(">Delete"); + else if (choice.equals("Delete")) { + System.out.println( + "Are you sure you want to delete the Highscore file?\nAs a confirmation type: 'I AM SURE': "); choice = sc.nextLine(); - if (choice.equals("Return")) - break; - else if (choice.equals("Delete")) { - System.out.println( - "Are you sure you want to delete the Highscore file?\nAs a confirmation type: 'I AM SURE': "); - choice = sc.nextLine(); - if (choice.equals("I AM SURE")) { - game.deleteHighscores(); - System.out.println("Highscore file got deleted...\nReturning to the main menu..."); - } else { - System.out.println("Highscore file not deleted...\nReturning to the main menu..."); - } - + if (choice.equals("I AM SURE")) { + game.deleteHighscores(); + System.out.println("Highscore file got deleted...\nReturning to the main menu..."); + } else { + System.out.println("Highscore file not deleted...\nReturning to the main menu..."); } } - else if (choice.equals("Play")) { + } - System.out.println("Choose your gamemode: "); - System.out.println(">Normal"); - System.out.println(">StarWarsDay"); - System.out.println(">Special8"); - game.setGamemode(sc.nextLine()); - System.out.println("Amount of players: "); - System.out.println(">1-6"); - game.setPlayercount(sc.nextInt()); - System.out.println("Type in the player names, lock in each name with Enter: "); - System.out.println(">ex. Lucas [Enter] William [Enter] Lena [Enter]"); + else if (choice.equals("Play")) { + + System.out.println("Choose your gamemode: "); + System.out.println(">Normal"); + System.out.println(">StarWarsDay"); + System.out.println(">Special8"); + game.setGamemode(sc.nextLine()); + System.out.println("Amount of players: "); + System.out.println(">1-6"); + game.setPlayercount(sc.nextInt()); + System.out.println("Type in the player names, lock in each name with Enter: "); + System.out.println(">ex. Lucas [Enter] William [Enter] Lena [Enter]"); + + String playerNames[] = new String[game.playerCount]; + for (int i = 0; i < game.playerCount; i++) { + playerNames[i] = sc.nextLine(); + } + + game.setPlayerNames(playerNames); + + while (!game.gameOverAll()) { - String playerNames[] = new String[game.playerCount]; for (int i = 0; i < game.playerCount; i++) { - playerNames[i] = sc.nextLine(); - } - game.setPlayerNames(playerNames); + if (game.gameOver(i)) + continue; - while (!game.gameOverAll()) { + System.out.println("Its your turn " + game.getPlayerName(i)); + System.out.println("This is your Yahtzee Box: "); + System.out.println(game.selectedOptionsPrinted(i) + "\n"); - for (int i = 0; i < game.playerCount; i++) { + while (!game.allDicesLockedIn(i) || !game.noMoreRolls(i)) { - if (game.gameOver(i)) - continue; + System.out.println("Your dices: "); + System.out.println("Free dices: " + game.getFreeDiceNumbers(i)); + System.out.println("Locked in dices: " + game.getLockedInDiceNumbers(i)); + System.out.println( + "Type in which free dices you want to keep \n(seperated by space, type 'none' if you dont want to keep any): "); + choice = sc.nextLine(); + game.lockInDices(i, choice.split(" ")); + game.rollDices(i); + System.out.println(game.getLeftRolls(i) + " rolls left"); + System.out.println("Rerolling dices... "); - System.out.println("Its your turn " + game.getPlayerName(i)); - System.out.println("This is your Yahtzee Box: "); - System.out.println(game.selectedOptionsPrinted(i) + "\n"); + } - while (!game.allDicesLockedIn(i) || !game.noMoreRolls(i)) { + System.out.println("Done locking in... Here are your options: "); + System.out.println(game.optionsPrinted(i)); + System.out.println("Which option you want to select?: "); + game.selectOption(i, sc.nextLine()); - System.out.println("Your dices: "); - System.out.println("Free dices: " + game.getFreeDiceNumbers(i)); - System.out.println("Locked in dices: " + game.getLockedInDiceNumbers(i)); - System.out.println( - "Type in which free dices you want to keep \n(seperated by space, type 'none' if you dont want to keep any): "); - choice = sc.nextLine(); - game.lockInDices(i, choice.split(" ")); - game.rollDices(i); - System.out.println(game.getLeftRolls(i) + " rolls left"); - System.out.println("Rerolling dices... "); - - } - - System.out.println("Done locking in... Here are your options: "); - System.out.println(game.optionsPrinted(i)); - 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)); - } + if (game.gameOver(i)) { + System.out.println( + "Your game is over, here is your total score: " + game.returnTotalPoints(i)); } } - - System.out.println("The game is over, saving all highscores to the highscore table..."); - game.saveAllPlayersHighscores(); - } + + System.out.println("The 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:"); + choice = sc.nextLine(); } } } - }