From b207c6ab8812696857dc859f1560f5e546b95946 Mon Sep 17 00:00:00 2001 From: "s.eser" Date: Sun, 28 Apr 2024 20:52:08 +0200 Subject: [PATCH] tui --- bin/facade/YahtzeeGame.class | Bin 8808 -> 8731 bytes bin/ui/TUI.class | Bin 240 -> 526 bytes src/domain/Player.java | 1 + src/facade/YahtzeeGame.java | 38 ++++++++++++++--- src/ui/TUI.java | 78 +++++++++++++++++++++++++++++++---- 5 files changed, 102 insertions(+), 15 deletions(-) diff --git a/bin/facade/YahtzeeGame.class b/bin/facade/YahtzeeGame.class index 9836209e8305ab64f3965751f7b0cf76bf4a232d..48bd58a6aa0fed421d72cec85f25dc9884e0dc06 100644 GIT binary patch delta 1794 zcmcgtXK++i6#l+@-+gb{>}Jzo6B5!05VF+JAs{884Mk)GH54(FfDA!a+Q`ffBZGhl z$Ww^Y2PKLK#KfgZ5kwJzzyJ{hr6>ZT^w1&Rtp3pdj`QA}{?0k?zVn@TDSJt_bN`dA zI{!X3hE4-NCiI8lMf zC?w&&3v2LzsF&Wup3Z1{rxoLV%VRlmEUQ^b$su;$R#hLqfbZX~9XjdW;)4VnUa(!~A~T8WZhg zcZQKnB-$NaiS}6cvRctF;L%rg#GnS^^p%8owA8$_j;b3zSEV8nX?B4p$u1AiVtPo* z^klJ-mU7u#(^~c=Pb<|HQOL5>A_lW#C}vf}i>fQq(9Jd@{qEk{+XuDL7fsR6o*6lq z&xWF8RL^R;y7nN{#SnWy)WSM>aA3HO9tkhwxF}}nd{emMf z5fYPNVJc!VO}8A-tFMQ0khE$b1)EZ!jHL_g159~9^S@$6k-8ZXsHMb zu>m%Mcn90{N8O7>IEckKrXx<{JzT*1xQZpXgQa+aWwfxI9?YaSfK|-EYBs?KY>f}u z0c+R~MI4Ba=*P#Lg0-BDPq+Z7*ej;vYcUJoi22wj z7UNs70{g`pd?(i9fY^kCViyjHeJB%$aaf$h5phl@y^N#c5spiNa_PkPG6E-LZJd<# z@q^64DcKXJWiEb{FX1OS25001oRw2?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$3%yrLt#HqvXO Q86#gx{&N`1cs4`W-)ec36aWAK diff --git a/bin/ui/TUI.class b/bin/ui/TUI.class index eb2cafb22a9cb71c15edf0e64d71de6b4faa3b6f..0f845fa93eecdf47e9fc74760d88b861e403b5f1 100644 GIT binary patch delta 368 zcmZutu}%U(5S>L%xD^EvP`i-|2$5bZ3ymgrCnm;f?;K(EZkH@8!NO46nA{gw`voSN zXz$nf1;*t}w6U2t^WNl5-h8r$JpcH5c>{nw*i8A|ET0Ie7&Kbv$5&z^da+Q0USN$> zgWdLN0ah85|Ac*Gv?;F10Lub6VZW;i9zwCf3!Uh1zYK(&vNNgr|-d%drAqItDeJUhd!)8 m*)avzcVHpY_$yS-s?}$xy*oAs+||WQsbvm1H#1nzw2f~hNL@$( delta 58 zcmeBU`M}6^>ff$?3=9m83<49mYA5G1Dl#%o?q}4JWoF<83iB{90!daN%?qR%8Tf!C H69Yd0oMQPlay"); + System.out.println(">Highscores"); + choice = sc.nextLine(); - if(High) + if(choice.equals("Highscores")){ + System.out.println(game.showHighscores()); + System.out.println(">Return"); + System.out.println(">Delete"); + 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..."); + } + + } + } + + + 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()) { + + for(int i = 0; i