Ver código fonte

UML except craps

Jennifer Chao 6 anos atrás
pai
commit
cbf72f1624

src/main/java/io/zipcoder/casino/BlackJack.java → src/main/java/io/zipcoder/casino/CardGame/BlackJack/BlackJack.java Ver arquivo

@@ -1,4 +1,9 @@
1
-package io.zipcoder.casino;
1
+package io.zipcoder.casino.CardGame.BlackJack;
2
+
3
+import io.zipcoder.casino.CardGame.Card;
4
+import io.zipcoder.casino.CardGame.CardGame;
5
+import io.zipcoder.casino.Interfaces.Gamble;
6
+import io.zipcoder.casino.Player;
2 7
 
3 8
 import java.util.ArrayList;
4 9
 

src/main/java/io/zipcoder/casino/BlackJackPlayer.java → src/main/java/io/zipcoder/casino/CardGame/BlackJack/BlackJackPlayer.java Ver arquivo

@@ -1,4 +1,7 @@
1
-package io.zipcoder.casino;
1
+package io.zipcoder.casino.CardGame.BlackJack;
2
+
3
+import io.zipcoder.casino.CardGame.Card;
4
+import io.zipcoder.casino.Player;
2 5
 
3 6
 public class BlackJackPlayer {
4 7
 

src/main/java/io/zipcoder/casino/Card.java → src/main/java/io/zipcoder/casino/CardGame/Card.java Ver arquivo

@@ -1,4 +1,4 @@
1
-package io.zipcoder.casino;
1
+package io.zipcoder.casino.CardGame;
2 2
 
3 3
 public class Card {
4 4
 

src/main/java/io/zipcoder/casino/CardGame.java → src/main/java/io/zipcoder/casino/CardGame/CardGame.java Ver arquivo

@@ -1,6 +1,6 @@
1
-package io.zipcoder.casino;
1
+package io.zipcoder.casino.CardGame;
2 2
 
3
-import java.util.ArrayList;
3
+import io.zipcoder.casino.Interfaces.Game;
4 4
 
5 5
 public abstract class CardGame implements Game {
6 6
 

src/main/java/io/zipcoder/casino/Deck.java → src/main/java/io/zipcoder/casino/CardGame/Deck.java Ver arquivo

@@ -1,4 +1,4 @@
1
-package io.zipcoder.casino;
1
+package io.zipcoder.casino.CardGame;
2 2
 
3 3
 public class Deck {
4 4
 

src/main/java/io/zipcoder/casino/Foundation.java → src/main/java/io/zipcoder/casino/CardGame/Solitaire/Foundation.java Ver arquivo

@@ -1,4 +1,6 @@
1
-package io.zipcoder.casino;
1
+package io.zipcoder.casino.CardGame.Solitaire;
2
+
3
+import io.zipcoder.casino.CardGame.Card;
2 4
 
3 5
 import java.util.Stack;
4 6
 

src/main/java/io/zipcoder/casino/Solitaire.java → src/main/java/io/zipcoder/casino/CardGame/Solitaire/Solitaire.java Ver arquivo

@@ -1,4 +1,8 @@
1
-package io.zipcoder.casino;
1
+package io.zipcoder.casino.CardGame.Solitaire;
2
+
3
+import io.zipcoder.casino.CardGame.Card;
4
+import io.zipcoder.casino.CardGame.CardGame;
5
+import io.zipcoder.casino.Player;
2 6
 
3 7
 public class Solitaire extends CardGame {
4 8
 

src/main/java/io/zipcoder/casino/Tableau.java → src/main/java/io/zipcoder/casino/CardGame/Solitaire/Tableau.java Ver arquivo

@@ -1,4 +1,6 @@
1
-package io.zipcoder.casino;
1
+package io.zipcoder.casino.CardGame.Solitaire;
2
+
3
+import io.zipcoder.casino.CardGame.Card;
2 4
 
3 5
 import java.util.Stack;
4 6
 

+ 5
- 0
src/main/java/io/zipcoder/casino/Casino.java Ver arquivo

@@ -8,6 +8,11 @@ package io.zipcoder.casino;
8 8
 
9 9
 // Jackpot option? Low chance but player wins $1mil
10 10
 
11
+import io.zipcoder.casino.CardGame.BlackJack.BlackJack;
12
+import io.zipcoder.casino.DiceGame.Craps.Craps;
13
+import io.zipcoder.casino.CardGame.Solitaire.Solitaire;
14
+import io.zipcoder.casino.Interfaces.Game;
15
+
11 16
 public class Casino {
12 17
 
13 18
     private int money;

+ 0
- 19
src/main/java/io/zipcoder/casino/Craps.java Ver arquivo

@@ -1,19 +0,0 @@
1
-package io.zipcoder.casino;
2
-
3
-import java.util.Map;
4
-
5
-public class Craps extends DiceGame implements Gamble {
6
-
7
-    private Player player;
8
-    private int hold;
9
-    private Map<Integer, Integer> betPots;
10
-
11
-    public Craps(Player player) {
12
-        this.player = player;
13
-    }
14
-
15
-    public int rollDice() {
16
-        return 0;
17
-    }
18
-
19
-}

+ 50
- 0
src/main/java/io/zipcoder/casino/DiceGame/Craps/Craps.java Ver arquivo

@@ -0,0 +1,50 @@
1
+package io.zipcoder.casino.DiceGame.Craps;
2
+
3
+import io.zipcoder.casino.DiceGame.DiceGame;
4
+import io.zipcoder.casino.Interfaces.Gamble;
5
+import io.zipcoder.casino.Player;
6
+
7
+import java.util.Map;
8
+
9
+public class Craps extends DiceGame implements Gamble {
10
+
11
+    private Player player;
12
+    private int hold;
13
+    private Map<Integer, Integer> betPots;
14
+
15
+    public Craps(Player player) {
16
+        this.player = player;
17
+    }
18
+
19
+    public int rollDice() {
20
+        return 0;
21
+    }
22
+
23
+    public int betAmount(int amount, Player player) {
24
+        return 0;
25
+    }
26
+
27
+    public void distributePot(int amount, Player player) {
28
+
29
+    }
30
+
31
+    public void start() {
32
+
33
+    }
34
+
35
+    public void end() {
36
+
37
+    }
38
+
39
+    public void takeATurn() {
40
+
41
+    }
42
+
43
+    public void addPlayer() {
44
+
45
+    }
46
+
47
+    public void removePlayer() {
48
+
49
+    }
50
+}

src/main/java/io/zipcoder/casino/Dice.java → src/main/java/io/zipcoder/casino/DiceGame/Dice.java Ver arquivo

@@ -1,4 +1,4 @@
1
-package io.zipcoder.casino;
1
+package io.zipcoder.casino.DiceGame;
2 2
 
3 3
 public class Dice {
4 4
 

src/main/java/io/zipcoder/casino/DiceGame.java → src/main/java/io/zipcoder/casino/DiceGame/DiceGame.java Ver arquivo

@@ -1,4 +1,6 @@
1
-package io.zipcoder.casino;
1
+package io.zipcoder.casino.DiceGame;
2
+
3
+import io.zipcoder.casino.Interfaces.Game;
2 4
 
3 5
 public abstract class DiceGame implements Game {
4 6
 

src/main/java/io/zipcoder/casino/Gamble.java → src/main/java/io/zipcoder/casino/Interfaces/Gamble.java Ver arquivo

@@ -1,4 +1,6 @@
1
-package io.zipcoder.casino;
1
+package io.zipcoder.casino.Interfaces;
2
+
3
+import io.zipcoder.casino.Player;
2 4
 
3 5
 public interface Gamble {
4 6
     int betAmount(int amount, Player player);

src/main/java/io/zipcoder/casino/Game.java → src/main/java/io/zipcoder/casino/Interfaces/Game.java Ver arquivo

@@ -1,4 +1,4 @@
1
-package io.zipcoder.casino;
1
+package io.zipcoder.casino.Interfaces;
2 2
 
3 3
 public interface Game {
4 4
     void start();

+ 0
- 4
src/main/java/io/zipcoder/casino/test.java Ver arquivo

@@ -1,4 +0,0 @@
1
-package io.zipcoder.casino;
2
-
3
-public class test {
4
-}