diff --git a/YahtzeeStarWarsSpecial.jar b/YahtzeeStarWarsSpecial.jar index b85d738..479e78e 100644 Binary files a/YahtzeeStarWarsSpecial.jar and b/YahtzeeStarWarsSpecial.jar differ diff --git a/bin/csv/highscores.csv b/bin/csv/highscores.csv index 132a297..b7c8196 100644 --- a/bin/csv/highscores.csv +++ b/bin/csv/highscores.csv @@ -1,10 +1,10 @@ 2024-04-30 Selim 254 2024-04-30 Enes 127 +2024-05-05 Daniil 121 +2024-05-05 Selim 112 2024-04-30 David 82 2024-04-30 Olaf 72 ___ ___ 0 ___ ___ 0 ___ ___ 0 ___ ___ 0 -___ ___ 0 -___ ___ 0 diff --git a/bin/domain/Box.class b/bin/domain/Box.class index efc2e02..56c84e3 100644 Binary files a/bin/domain/Box.class and b/bin/domain/Box.class differ diff --git a/bin/domain/Dice.class b/bin/domain/Dice.class index 84b2350..596a7ed 100644 Binary files a/bin/domain/Dice.class and b/bin/domain/Dice.class differ diff --git a/bin/facade/YahtzeeGame.class b/bin/facade/YahtzeeGame.class index 060ff62..7a11635 100644 Binary files a/bin/facade/YahtzeeGame.class and b/bin/facade/YahtzeeGame.class differ diff --git a/src/csv/highscores.csv b/src/csv/highscores.csv index 132a297..b7c8196 100644 --- a/src/csv/highscores.csv +++ b/src/csv/highscores.csv @@ -1,10 +1,10 @@ 2024-04-30 Selim 254 2024-04-30 Enes 127 +2024-05-05 Daniil 121 +2024-05-05 Selim 112 2024-04-30 David 82 2024-04-30 Olaf 72 ___ ___ 0 ___ ___ 0 ___ ___ 0 ___ ___ 0 -___ ___ 0 -___ ___ 0 diff --git a/src/domain/Box.java b/src/domain/Box.java index 307468b..6eaf018 100644 --- a/src/domain/Box.java +++ b/src/domain/Box.java @@ -224,9 +224,9 @@ public class Box { res.add("Five: " + categoryFive); if (setCategorySix == null) res.add("Six: " + categorySix); - if (setCategorySeven == null && savedGamemode.equals("Special8")) + if (setCategorySeven == null && savedGamemode.equalsIgnoreCase("Special8")) res.add("Seven: " + categorySeven); - if (setCategoryEight == null && savedGamemode.equals("Special8")) + if (setCategoryEight == null && savedGamemode.equalsIgnoreCase("Special8")) res.add("Eight: " + categoryEight); if (setCategoryTripleMatch == null) res.add("TripleMatch: " + categoryTripleMatch); @@ -244,7 +244,7 @@ public class Box { res.add("Chance: " + categoryChance); if (setCategoryStarWarsDay == null) res.add("StarWarsDay: " + categoryStarWarsDay); - if (setCategoryR2D2 == null && savedGamemode.equals("Special8")) + if (setCategoryR2D2 == null && savedGamemode.equalsIgnoreCase("Special8")) res.add("R2D2: " + categoryR2D2); } @@ -329,7 +329,7 @@ public class Box { public boolean gameOver() { - if (this.savedGamemode.equals("Special8")) + if (this.savedGamemode.equalsIgnoreCase("Special8")) return setCategoryOne != null && setCategoryTwo != null && setCategoryThree != null && @@ -368,7 +368,7 @@ public class Box { public void updateBonus() { - if (savedGamemode.equals("Special8")) { + if (savedGamemode.equalsIgnoreCase("Special8")) { if (nullCheckInt(setCategoryOne) + nullCheckInt(setCategoryTwo) + nullCheckInt(setCategoryThree) + nullCheckInt(setCategoryFour) @@ -389,7 +389,7 @@ public class Box { public int returnTotalPoints() { - if (savedGamemode.equals("Special8")) + if (savedGamemode.equalsIgnoreCase("Special8")) return setCategoryOne + setCategoryTwo + setCategoryThree + setCategoryFour + setCategoryFive + setCategorySix + setCategorySeven + setCategoryEight + nullCheckInt(bonus) + setCategoryTripleMatch @@ -410,7 +410,7 @@ public class Box { StringBuilder sb = new StringBuilder(); - if (savedGamemode.equals("Special8")) { + if (savedGamemode.equalsIgnoreCase("Special8")) { sb.append("\n--------------------------\n\n"); sb.append("One: " + nullCheck(setCategoryOne) + "\n"); sb.append("Two: " + nullCheck(setCategoryTwo) + "\n"); @@ -464,7 +464,7 @@ public class Box { public void updateUpperBoxScore() { - if (savedGamemode.equals("Special8")) + if (savedGamemode.equalsIgnoreCase("Special8")) this.upperBoxScore = nullCheckInt(setCategoryOne) + nullCheckInt(setCategoryTwo) + nullCheckInt(setCategoryThree) + nullCheckInt(setCategoryFour) @@ -481,7 +481,7 @@ public class Box { public void updateLowerBoxScore() { - if (savedGamemode.equals("Special8")) + if (savedGamemode.equalsIgnoreCase("Special8")) this.lowerBoxScore = nullCheckInt(setCategoryTripleMatch) + nullCheckInt(setCategoryFourOfAKind) + nullCheckInt(setCategoryFullHouse) + nullCheckInt(setCategorySmallStreet) diff --git a/src/domain/Dice.java b/src/domain/Dice.java index 1d22a0f..d3da19f 100644 --- a/src/domain/Dice.java +++ b/src/domain/Dice.java @@ -9,9 +9,9 @@ public class Dice { public Dice(String gamemode) { this.savedGamemode = gamemode; - if (gamemode.equals("Normal")) + if (gamemode.equalsIgnoreCase("Normal")) this.diceNumber = ((int) (Math.random() * 6)) + 1; - else if (gamemode.equals("Special8")) + else if (gamemode.equalsIgnoreCase("Special8")) this.diceNumber = ((int) (Math.random() * 8)) + 1; } @@ -22,9 +22,9 @@ public class Dice { public void rerollDice() { - if (this.savedGamemode.equals("Normal")) + if (this.savedGamemode.equalsIgnoreCase("Normal")) this.diceNumber = ((int) (Math.random() * 6)) + 1; - else if (this.savedGamemode.equals("Special8")) + else if (this.savedGamemode.equalsIgnoreCase("Special8")) this.diceNumber = ((int) (Math.random() * 8)) + 1; } diff --git a/src/facade/YahtzeeGame.java b/src/facade/YahtzeeGame.java index 570580e..8049a42 100644 --- a/src/facade/YahtzeeGame.java +++ b/src/facade/YahtzeeGame.java @@ -186,7 +186,7 @@ public class YahtzeeGame { Scanner scSp = new Scanner(new File("src/csv/highscoresSpecial8.csv")); String mem[] = new String[3]; - if (savedGamemode.equals("Special8")) + if (savedGamemode.equalsIgnoreCase("Special8")) for (int i = 0; i < 10; i++) { @@ -440,7 +440,7 @@ 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)); - if (savedGamemode.equals("Special8")) + if (savedGamemode.equalsIgnoreCase("Special8")) for (int i = 0; i < 10; i++) { outSp.print(highscores[i][0] + " " + highscores[i][1] + " " @@ -494,7 +494,7 @@ 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)); - if (savedGamemode.equals("Special8")) + if (savedGamemode.equalsIgnoreCase("Special8")) outSp.print(""); else out.print("");