Przeglądaj źródła

setRow method written

Lauren Green 6 lat temu
rodzic
commit
155881a102
1 zmienionych plików z 15 dodań i 2 usunięć
  1. 15
    2
      src/main/java/io/zipcoder/casino/ScoreSheet.java

+ 15
- 2
src/main/java/io/zipcoder/casino/ScoreSheet.java Wyświetl plik

@@ -47,40 +47,53 @@ public class ScoreSheet {
47 47
 
48 48
     }
49 49
 
50
-    public void setRow(ROW row){
50
+    public void setRow(ROW row, Dice[] cup){
51 51
 
52 52
         switch(row) {
53 53
             case ACES:
54
+                scores.put(ROW.ACES, calculateScore(ROW.ACES, cup);
54 55
                 break;
55 56
             case TWOS:
57
+                scores.put(ROW.TWOS, calculateScore(ROW.TWOS, cup);
56 58
                 break;
57 59
             case THREES:
60
+                scores.put(ROW.THREES, calculateScore(ROW.THREES, cup);
58 61
                 break;
59 62
             case FOURS:
63
+                scores.put(ROW.FOURS, calculateScore(ROW.FOURS, cup);
60 64
                 break;
61 65
             case FIVES:
66
+                scores.put(ROW.FIVES, calculateScore(ROW.FIVES, cup);
62 67
                 break;
63 68
             case SIXES:
69
+                scores.put(ROW.SIXES, calculateScore(ROW.SIXES, cup);
64 70
                 break;
65 71
             case THREEOFAKIND:
72
+                scores.put(ROW.THREEOFAKIND, calculateScore(ROW.THREEOFAKIND, cup);
66 73
                 break;
67 74
             case FOUROFAKIND:
75
+                scores.put(ROW.FOUROFAKIND, calculateScore(ROW.FOUROFAKIND, cup);
68 76
                 break;
69 77
             case FULLHOUSE:
78
+                scores.put(ROW.FULLHOUSE, calculateScore(ROW.FULLHOUSE, cup);
70 79
                 break;
71 80
             case SMALLSTRAIGHT:
81
+                scores.put(ROW.SMALLSTRAIGHT, calculateScore(ROW.SMALLSTRAIGHT, cup);
72 82
                 break;
73 83
             case LARGESTRAIGHT:
84
+                scores.put(ROW.LARGESTRAIGHT, calculateScore(ROW.LARGESTRAIGHT, cup);
74 85
                 break;
75 86
             case YAHTZEE:
87
+                scores.put(ROW.YAHTZEE, calculateScore(ROW.YAHTZEE, cup);
76 88
                 break;
77 89
             case CHANCE:
90
+                scores.put(ROW.CHANCE, calculateScore(ROW.CHANCE, cup);
78 91
                 break;
79 92
         }
80 93
 
81 94
     }
82 95
 
83
-    public void calculateScore(ROW row, int value){
96
+    public void calculateScore(ROW row, Dice[] cup){
84 97
 
85 98
     }
86 99
 }