瀏覽代碼

trying to fixt it

CHU1TA26 6 年之前
父節點
當前提交
ffc33d3a43

二進制
.DS_Store 查看文件


+ 12
- 0
pom.xml 查看文件

@@ -7,6 +7,18 @@
7 7
     <groupId>io.zipcoder</groupId>
8 8
     <artifactId>casino</artifactId>
9 9
     <version>1.0-SNAPSHOT</version>
10
+    <build>
11
+        <plugins>
12
+            <plugin>
13
+                <groupId>org.apache.maven.plugins</groupId>
14
+                <artifactId>maven-compiler-plugin</artifactId>
15
+                <configuration>
16
+                    <source>8</source>
17
+                    <target>8</target>
18
+                </configuration>
19
+            </plugin>
20
+        </plugins>
21
+    </build>
10 22
 
11 23
     <dependencies>
12 24
         <dependency>

二進制
src/.DS_Store 查看文件


+ 7
- 0
src/.idea/misc.xml 查看文件

@@ -0,0 +1,7 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="JavaScriptSettings">
4
+    <option name="languageLevel" value="ES6" />
5
+  </component>
6
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
7
+</project>

+ 8
- 0
src/.idea/modules.xml 查看文件

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ProjectModuleManager">
4
+    <modules>
5
+      <module fileurl="file://$PROJECT_DIR$/.idea/src.iml" filepath="$PROJECT_DIR$/.idea/src.iml" />
6
+    </modules>
7
+  </component>
8
+</project>

+ 6
- 0
src/.idea/vcs.xml 查看文件

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="VcsDirectoryMappings">
4
+    <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
5
+  </component>
6
+</project>

+ 345
- 0
src/.idea/workspace.xml 查看文件

@@ -0,0 +1,345 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="5ecb3535-f2ec-4c28-8330-3b5111ca22b5" name="Default Changelist" comment="">
5
+      <change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
6
+      <change beforePath="$PROJECT_DIR$/main/java/io/zipcoder/casino/Wallet.java" beforeDir="false" />
7
+    </list>
8
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
9
+    <option name="SHOW_DIALOG" value="false" />
10
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
11
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
12
+    <option name="LAST_RESOLUTION" value="IGNORE" />
13
+  </component>
14
+  <component name="FUSProjectUsageTrigger">
15
+    <session id="1794482179">
16
+      <usages-collector id="statistics.lifecycle.project">
17
+        <counts>
18
+          <entry key="project.closed" value="1" />
19
+          <entry key="project.open.time.0" value="1" />
20
+          <entry key="project.opened" value="1" />
21
+        </counts>
22
+      </usages-collector>
23
+      <usages-collector id="statistics.file.extensions.open">
24
+        <counts>
25
+          <entry key="java" value="7" />
26
+        </counts>
27
+      </usages-collector>
28
+      <usages-collector id="statistics.file.types.open">
29
+        <counts>
30
+          <entry key="JAVA" value="7" />
31
+        </counts>
32
+      </usages-collector>
33
+    </session>
34
+  </component>
35
+  <component name="FileEditorManager">
36
+    <leaf>
37
+      <file pinned="false" current-in-tab="false">
38
+        <entry file="file://$PROJECT_DIR$/main/java/io/zipcoder/casino/Card.java">
39
+          <provider selected="true" editor-type-id="text-editor" />
40
+        </entry>
41
+      </file>
42
+      <file pinned="false" current-in-tab="false">
43
+        <entry file="file://$PROJECT_DIR$/main/java/io/zipcoder/casino/Casino.java">
44
+          <provider selected="true" editor-type-id="text-editor" />
45
+        </entry>
46
+      </file>
47
+      <file pinned="false" current-in-tab="false">
48
+        <entry file="file://$PROJECT_DIR$/main/java/io/zipcoder/casino/Dealer.java">
49
+          <provider selected="true" editor-type-id="text-editor" />
50
+        </entry>
51
+      </file>
52
+      <file pinned="false" current-in-tab="true">
53
+        <entry file="file://$PROJECT_DIR$/main/java/io/zipcoder/casino/Deck.java">
54
+          <provider selected="true" editor-type-id="text-editor" />
55
+        </entry>
56
+      </file>
57
+      <file pinned="false" current-in-tab="false">
58
+        <entry file="file://$PROJECT_DIR$/main/java/io/zipcoder/casino/Rank.java">
59
+          <provider selected="true" editor-type-id="text-editor" />
60
+        </entry>
61
+      </file>
62
+      <file pinned="false" current-in-tab="false">
63
+        <entry file="file://$PROJECT_DIR$/main/java/io/zipcoder/casino/Suit.java">
64
+          <provider selected="true" editor-type-id="text-editor" />
65
+        </entry>
66
+      </file>
67
+    </leaf>
68
+  </component>
69
+  <component name="Git.Settings">
70
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
71
+  </component>
72
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
73
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
74
+  <component name="JsGulpfileManager">
75
+    <detection-done>true</detection-done>
76
+    <sorting>DEFINITION_ORDER</sorting>
77
+  </component>
78
+  <component name="ProjectFrameBounds" extendedState="6">
79
+    <option name="width" value="1280" />
80
+    <option name="height" value="800" />
81
+  </component>
82
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
83
+  <component name="ProjectView">
84
+    <navigator proportions="" version="1">
85
+      <foldersAlwaysOnTop value="true" />
86
+    </navigator>
87
+    <panes>
88
+      <pane id="Scope" />
89
+      <pane id="PackagesPane" />
90
+      <pane id="ProjectPane">
91
+        <subPane>
92
+          <expand>
93
+            <path>
94
+              <item name="src" type="b2602c69:ProjectViewProjectNode" />
95
+              <item name="src" type="462c0819:PsiDirectoryNode" />
96
+            </path>
97
+            <path>
98
+              <item name="src" type="b2602c69:ProjectViewProjectNode" />
99
+              <item name="src" type="462c0819:PsiDirectoryNode" />
100
+              <item name="main" type="462c0819:PsiDirectoryNode" />
101
+            </path>
102
+            <path>
103
+              <item name="src" type="b2602c69:ProjectViewProjectNode" />
104
+              <item name="src" type="462c0819:PsiDirectoryNode" />
105
+              <item name="main" type="462c0819:PsiDirectoryNode" />
106
+              <item name="java" type="462c0819:PsiDirectoryNode" />
107
+            </path>
108
+            <path>
109
+              <item name="src" type="b2602c69:ProjectViewProjectNode" />
110
+              <item name="src" type="462c0819:PsiDirectoryNode" />
111
+              <item name="main" type="462c0819:PsiDirectoryNode" />
112
+              <item name="java" type="462c0819:PsiDirectoryNode" />
113
+              <item name="io" type="462c0819:PsiDirectoryNode" />
114
+            </path>
115
+            <path>
116
+              <item name="src" type="b2602c69:ProjectViewProjectNode" />
117
+              <item name="src" type="462c0819:PsiDirectoryNode" />
118
+              <item name="main" type="462c0819:PsiDirectoryNode" />
119
+              <item name="java" type="462c0819:PsiDirectoryNode" />
120
+              <item name="io" type="462c0819:PsiDirectoryNode" />
121
+              <item name="zipcoder" type="462c0819:PsiDirectoryNode" />
122
+            </path>
123
+            <path>
124
+              <item name="src" type="b2602c69:ProjectViewProjectNode" />
125
+              <item name="src" type="462c0819:PsiDirectoryNode" />
126
+              <item name="main" type="462c0819:PsiDirectoryNode" />
127
+              <item name="java" type="462c0819:PsiDirectoryNode" />
128
+              <item name="io" type="462c0819:PsiDirectoryNode" />
129
+              <item name="zipcoder" type="462c0819:PsiDirectoryNode" />
130
+              <item name="casino" type="462c0819:PsiDirectoryNode" />
131
+            </path>
132
+          </expand>
133
+          <select />
134
+        </subPane>
135
+      </pane>
136
+    </panes>
137
+  </component>
138
+  <component name="PropertiesComponent">
139
+    <property name="WebServerToolWindowFactoryState" value="false" />
140
+    <property name="aspect.path.notification.shown" value="true" />
141
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
142
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
143
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
144
+    <property name="project.structure.last.edited" value="Project" />
145
+    <property name="project.structure.proportion" value="0.15" />
146
+    <property name="project.structure.side.proportion" value="0.0" />
147
+  </component>
148
+  <component name="RunDashboard">
149
+    <option name="ruleStates">
150
+      <list>
151
+        <RuleState>
152
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
153
+        </RuleState>
154
+        <RuleState>
155
+          <option name="name" value="StatusDashboardGroupingRule" />
156
+        </RuleState>
157
+      </list>
158
+    </option>
159
+  </component>
160
+  <component name="SvnConfiguration">
161
+    <configuration />
162
+  </component>
163
+  <component name="TaskManager">
164
+    <task active="true" id="Default" summary="Default task">
165
+      <changelist id="5ecb3535-f2ec-4c28-8330-3b5111ca22b5" name="Default Changelist" comment="" />
166
+      <created>1541533165817</created>
167
+      <option name="number" value="Default" />
168
+      <option name="presentableId" value="Default" />
169
+      <updated>1541533165817</updated>
170
+      <workItem from="1541533167334" duration="737000" />
171
+    </task>
172
+    <servers />
173
+  </component>
174
+  <component name="TimeTrackingManager">
175
+    <option name="totallyTimeSpent" value="737000" />
176
+  </component>
177
+  <component name="ToolWindowManager">
178
+    <frame x="0" y="23" width="1280" height="722" extended-state="6" />
179
+    <editor active="true" />
180
+    <layout>
181
+      <window_info id="Image Layers" />
182
+      <window_info id="Designer" />
183
+      <window_info id="UI Designer" />
184
+      <window_info id="Capture Tool" />
185
+      <window_info id="Favorites" side_tool="true" />
186
+      <window_info content_ui="combo" id="Project" order="0" weight="0.24959612" />
187
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
188
+      <window_info anchor="bottom" id="Messages" />
189
+      <window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
190
+      <window_info anchor="bottom" id="Version Control" show_stripe_button="false" />
191
+      <window_info anchor="bottom" id="Terminal" />
192
+      <window_info anchor="bottom" id="Event Log" side_tool="true" />
193
+      <window_info anchor="bottom" id="Message" order="0" />
194
+      <window_info anchor="bottom" id="Find" order="1" />
195
+      <window_info anchor="bottom" id="Run" order="2" />
196
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
197
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
198
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
199
+      <window_info anchor="bottom" id="TODO" order="6" />
200
+      <window_info anchor="right" id="Palette" />
201
+      <window_info anchor="right" id="Theme Preview" />
202
+      <window_info anchor="right" id="Capture Analysis" />
203
+      <window_info anchor="right" id="Palette&#9;" />
204
+      <window_info anchor="right" id="Database" />
205
+      <window_info anchor="right" id="Maven Projects" />
206
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
207
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
208
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
209
+    </layout>
210
+    <layout-to-restore>
211
+      <window_info id="Image Layers" order="0" />
212
+      <window_info id="Designer" order="1" />
213
+      <window_info id="UI Designer" order="2" />
214
+      <window_info id="Capture Tool" order="3" />
215
+      <window_info id="Favorites" order="4" side_tool="true" />
216
+      <window_info active="true" content_ui="combo" id="Project" order="5" visible="true" weight="0.24959612" />
217
+      <window_info id="Structure" order="6" side_tool="true" weight="0.25" />
218
+      <window_info anchor="bottom" id="Version Control" order="0" show_stripe_button="false" />
219
+      <window_info anchor="bottom" id="Terminal" order="1" />
220
+      <window_info anchor="bottom" id="Event Log" order="2" side_tool="true" />
221
+      <window_info anchor="bottom" id="Database Changes" order="3" show_stripe_button="false" />
222
+      <window_info anchor="bottom" id="Messages" order="4" />
223
+      <window_info anchor="bottom" id="Message" order="5" />
224
+      <window_info anchor="bottom" id="Find" order="6" />
225
+      <window_info anchor="bottom" id="Run" order="7" />
226
+      <window_info anchor="bottom" id="Debug" order="8" weight="0.4" />
227
+      <window_info anchor="bottom" id="Cvs" order="9" weight="0.25" />
228
+      <window_info anchor="bottom" id="Inspection" order="10" weight="0.4" />
229
+      <window_info anchor="bottom" id="TODO" order="11" />
230
+      <window_info anchor="right" id="Palette" order="0" />
231
+      <window_info anchor="right" id="Capture Analysis" order="1" />
232
+      <window_info anchor="right" id="Database" order="2" />
233
+      <window_info anchor="right" id="Theme Preview" order="3" />
234
+      <window_info anchor="right" id="Palette&#9;" order="4" />
235
+      <window_info anchor="right" id="Maven Projects" order="5" />
236
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="6" type="SLIDING" weight="0.4" />
237
+      <window_info anchor="right" id="Ant Build" order="7" weight="0.25" />
238
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="8" weight="0.25" />
239
+    </layout-to-restore>
240
+  </component>
241
+  <component name="TypeScriptGeneratedFilesManager">
242
+    <option name="version" value="1" />
243
+  </component>
244
+  <component name="VcsContentAnnotationSettings">
245
+    <option name="myLimit" value="2678400000" />
246
+  </component>
247
+  <component name="editorHistoryManager">
248
+    <entry file="file://$PROJECT_DIR$/main/java/io/zipcoder/casino/Casino.java">
249
+      <provider selected="true" editor-type-id="text-editor" />
250
+    </entry>
251
+    <entry file="file://$PROJECT_DIR$/main/java/io/zipcoder/casino/Dealer.java">
252
+      <provider selected="true" editor-type-id="text-editor" />
253
+    </entry>
254
+    <entry file="file://$PROJECT_DIR$/main/java/io/zipcoder/casino/Wallet.java">
255
+      <provider selected="true" editor-type-id="text-editor" />
256
+    </entry>
257
+    <entry file="file://$PROJECT_DIR$/main/java/io/zipcoder/casino/Card.java">
258
+      <provider selected="true" editor-type-id="text-editor" />
259
+    </entry>
260
+    <entry file="file://$PROJECT_DIR$/main/java/io/zipcoder/casino/Rank.java">
261
+      <provider selected="true" editor-type-id="text-editor" />
262
+    </entry>
263
+    <entry file="file://$PROJECT_DIR$/main/java/io/zipcoder/casino/Suit.java">
264
+      <provider selected="true" editor-type-id="text-editor" />
265
+    </entry>
266
+    <entry file="file://$PROJECT_DIR$/main/java/io/zipcoder/casino/Deck.java">
267
+      <provider selected="true" editor-type-id="text-editor" />
268
+    </entry>
269
+  </component>
270
+  <component name="masterDetails">
271
+    <states>
272
+      <state key="ArtifactsStructureConfigurable.UI">
273
+        <settings>
274
+          <artifact-editor />
275
+          <splitter-proportions>
276
+            <option name="proportions">
277
+              <list>
278
+                <option value="0.2" />
279
+              </list>
280
+            </option>
281
+          </splitter-proportions>
282
+        </settings>
283
+      </state>
284
+      <state key="FacetStructureConfigurable.UI">
285
+        <settings>
286
+          <last-edited>No facets are configured</last-edited>
287
+          <splitter-proportions>
288
+            <option name="proportions">
289
+              <list>
290
+                <option value="0.2" />
291
+              </list>
292
+            </option>
293
+          </splitter-proportions>
294
+        </settings>
295
+      </state>
296
+      <state key="GlobalLibrariesConfigurable.UI">
297
+        <settings>
298
+          <splitter-proportions>
299
+            <option name="proportions">
300
+              <list>
301
+                <option value="0.2" />
302
+              </list>
303
+            </option>
304
+          </splitter-proportions>
305
+        </settings>
306
+      </state>
307
+      <state key="JdkListConfigurable.UI">
308
+        <settings>
309
+          <last-edited>1.8</last-edited>
310
+          <splitter-proportions>
311
+            <option name="proportions">
312
+              <list>
313
+                <option value="0.2" />
314
+              </list>
315
+            </option>
316
+          </splitter-proportions>
317
+        </settings>
318
+      </state>
319
+      <state key="ModuleStructureConfigurable.UI">
320
+        <settings>
321
+          <last-edited>src</last-edited>
322
+          <splitter-proportions>
323
+            <option name="proportions">
324
+              <list>
325
+                <option value="0.2" />
326
+                <option value="0.6" />
327
+              </list>
328
+            </option>
329
+          </splitter-proportions>
330
+        </settings>
331
+      </state>
332
+      <state key="ProjectLibrariesConfigurable.UI">
333
+        <settings>
334
+          <splitter-proportions>
335
+            <option name="proportions">
336
+              <list>
337
+                <option value="0.2" />
338
+              </list>
339
+            </option>
340
+          </splitter-proportions>
341
+        </settings>
342
+      </state>
343
+    </states>
344
+  </component>
345
+</project>

二進制
src/main/.DS_Store 查看文件


二進制
src/main/java/.DS_Store 查看文件


二進制
src/main/java/io/.DS_Store 查看文件


二進制
src/main/java/io/zipcoder/.DS_Store 查看文件


二進制
src/main/java/io/zipcoder/casino/.DS_Store 查看文件


+ 5
- 11
src/main/java/io/zipcoder/casino/BlackJackPlayer.java 查看文件

@@ -1,17 +1,11 @@
1 1
 package io.zipcoder.casino;
2 2
 
3
-import java.util.ArrayList;
4 3
 
5 4
 public class BlackJackPlayer extends Player {
6
-    public BlackJackPlayer(Wallet wallet, double bet) {
7
-        super(wallet, bet);
8
-    }
9
-
10
-    // private ArrayList  hand;
11
-
12
-
13
-
14
-
15
-}
5
+        public BlackJackPlayer(Wallet wallet, double bet) {
6
+            super(wallet, bet);
7
+        }
16 8
 
9
+        // private ArrayList  hand;
17 10
 
11
+    }

+ 29
- 0
src/main/java/io/zipcoder/casino/Card.java 查看文件

@@ -0,0 +1,29 @@
1
+package io.zipcoder.casino;
2
+
3
+public class Card {
4
+    private Suit suit;
5
+    private Rank rank;
6
+
7
+    public Card(Suit suit,Rank rank)
8
+    {
9
+        this.suit = suit;
10
+        this.rank = rank;
11
+    }
12
+
13
+    public Card() {
14
+
15
+    }
16
+
17
+    public Suit getSuit() {
18
+        return suit;
19
+    }
20
+
21
+    public Rank getRank() {
22
+        return rank;
23
+    }
24
+
25
+    public int getValue()
26
+    {
27
+    return rank.getPrimaryValue();
28
+    }
29
+}

+ 26
- 0
src/main/java/io/zipcoder/casino/Dealer.java 查看文件

@@ -0,0 +1,26 @@
1
+package io.zipcoder.casino;
2
+
3
+import java.util.ArrayList;
4
+
5
+public class Dealer {
6
+    private double wallet;
7
+    private ArrayList<String> hand;
8
+    private double Bet;
9
+
10
+    public Dealer(double wallet, ArrayList<String>hand, double Bet)
11
+    {
12
+        this.wallet=wallet;
13
+        this.hand=hand;
14
+    }
15
+
16
+    public void Deal()
17
+    {
18
+
19
+    }
20
+
21
+    public void TakeBet()
22
+    {
23
+
24
+    }
25
+
26
+}

+ 35
- 0
src/main/java/io/zipcoder/casino/Deck.java 查看文件

@@ -0,0 +1,35 @@
1
+package io.zipcoder.casino;
2
+
3
+import java.util.ArrayList;
4
+import java.util.Stack;
5
+
6
+
7
+public class Deck extends Card
8
+{
9
+    private ArrayList<Card> CardDeck;
10
+
11
+    public Deck(ArrayList<Card> CardDeck)
12
+    {
13
+        super();
14
+        this.CardDeck = CardDeck;
15
+    }
16
+
17
+    Stack<Card> tabledeck = new Stack<>();
18
+
19
+    public void PopulateDeck()
20
+    {
21
+        Deck newdeck = new Deck();
22
+
23
+        for(int i=0;i<=3;i++)
24
+        {
25
+            for(int j=0;j<13)
26
+            {
27
+                newdeck.add()
28
+
29
+            }
30
+        }
31
+
32
+    }
33
+
34
+
35
+}

+ 8
- 11
src/main/java/io/zipcoder/casino/Player.java 查看文件

@@ -3,22 +3,22 @@ package io.zipcoder.casino;
3 3
 public class Player {
4 4
     private Wallet wallet;
5 5
     private double bet;
6
-   // private  double hand;
6
+
7 7
 
8 8
     public Player(Wallet wallet, double bet) {
9 9
         this.bet = bet;
10
-        this.wallet=wallet;
10
+        this.wallet = wallet;
11 11
     }
12 12
 
13 13
 
14
-    public void play(){
14
+    public void play() {
15 15
 
16 16
     }
17 17
 
18 18
 
19
-    public void setBet (double money) {
19
+    public void bet(double money) {
20 20
 
21
-       this.bet = money;
21
+        this.bet = money;
22 22
     }
23 23
 
24 24
 
@@ -27,15 +27,12 @@ public class Player {
27 27
         return bet;
28 28
     }
29 29
 
30
-
31
-
32
-    public void addWining(){
30
+    public void addWining() {
33 31
 
34 32
         this.wallet.addMoney(bet);
35 33
     }
36 34
 
37
-    public void subtractLoss ()
38
-    {
35
+    public void subtractLoss() {
39 36
         this.wallet.takeMoney(bet);
40 37
     }
41
-}
38
+}

+ 40
- 0
src/main/java/io/zipcoder/casino/Rank.java 查看文件

@@ -0,0 +1,40 @@
1
+package io.zipcoder.casino;
2
+
3
+public enum Rank {
4
+    ACE(1, 11),
5
+    TWO(2),
6
+    THREE(3),
7
+    FOUR(4),
8
+    FIVE(5),
9
+    SIX(6),
10
+    SEVEN(7),
11
+    EIGHT(8),
12
+    NINE(9),
13
+    TEN(10),
14
+    JACK(10),
15
+    QUEEN(10),
16
+    KING(10);
17
+
18
+    private int primaryValue;
19
+    private int secondaryValue;
20
+
21
+    Rank(int primaryValue)
22
+    {
23
+        this.primaryValue = primaryValue;
24
+        this.secondaryValue = primaryValue;
25
+    }
26
+
27
+    Rank(int primaryValue, int secondaryValue)
28
+    {
29
+        this.primaryValue = primaryValue;
30
+        this.secondaryValue = secondaryValue;
31
+    }
32
+
33
+    public int getPrimaryValue() {
34
+        return primaryValue;
35
+    }
36
+
37
+    public int getSecondaryValue() {
38
+        return secondaryValue;
39
+    }
40
+}

+ 22
- 0
src/main/java/io/zipcoder/casino/Suit.java 查看文件

@@ -0,0 +1,22 @@
1
+package io.zipcoder.casino;
2
+
3
+public enum Suit {
4
+    DIAMOND("♦"),
5
+    CLUBS("♣"),
6
+    SPADES("♠"),
7
+    HEART("♥");
8
+
9
+    private final String Symbol;
10
+
11
+    Suit(String Symbol)
12
+    {
13
+        this.Symbol = Symbol;
14
+    }
15
+
16
+    public String getSymbol()
17
+    {
18
+        return Symbol;
19
+    }
20
+
21
+
22
+}

+ 8
- 1
src/test/java/io/zipcoder/casino/CasinoTest.java 查看文件

@@ -1,5 +1,12 @@
1 1
 package io.zipcoder.casino;
2 2
 
3 3
 
4
+import org.junit.Test;
5
+
4 6
 public class CasinoTest {
5
-}
7
+    @Test
8
+    public CardTest() {
9
+        Card newcard = new Card(Suit.HEART, Rank.TWO);
10
+        System.out.println(newcard);
11
+    }
12
+}

+ 30
- 31
src/test/java/io/zipcoder/casino/TestPlayer.java 查看文件

@@ -5,35 +5,34 @@ import org.junit.Test;
5 5
 
6 6
 public class TestPlayer {
7 7
 
8
-    @Test
9
-    public void testGetBet() {
10
-        //given
11
-        Wallet wallet = new Wallet(100.00, "Nury H.");
12
-        Player player = new Player(wallet, 50);
13
-        double expected = 50;
14
-        //when
8
+//    @Test
9
+//    public void testGetBet() {
10
+//        //given
11
+//        Wallet wallet = new Wallet(100.00, "Nury H.");
12
+//        Player player = new Player(wallet, 50);
13
+//        double expected = 50;
14
+//        //when
15
+//
16
+//
17
+//        Assert.assertEquals(expected, player.getBet(), 0.01);
18
+
19
+    // }
20
+
21
+//    @Test
22
+//    public void testAddWinnings() {
23
+//        //given
24
+//        Wallet wallet = new Wallet(100.00, "Nury H.");
25
+//        Player player = new Player(wallet, 50);
26
+//
27
+//        //when
28
+//
29
+//
30
+//
31
+//
32
+//
33
+//        Assert.assertEquals();
34
+
35
+    //}
36
+
37
+}
15 38
 
16
-
17
-        Assert.assertEquals(expected, player.getBet(), 0.01);
18
-
19
-    }
20
-
21
-    @Test
22
-    public void testAddWinnings() {
23
-        //given
24
-        Wallet wallet = new Wallet(100.00, "Nury H.");
25
-        Player player = new Player(wallet, 50);
26
-
27
-        //when
28
-
29
-
30
-
31
-
32
-
33
-        Assert.assertEquals();
34
-
35
-    }
36
-
37
-
38
-
39
-}

+ 8
- 16
src/test/java/io/zipcoder/casino/TestWallet.java 查看文件

@@ -1,5 +1,6 @@
1 1
 package io.zipcoder.casino;
2 2
 
3
+
3 4
 import org.junit.Assert;
4 5
 import org.junit.Test;
5 6
 
@@ -9,19 +10,16 @@ public class TestWallet {
9 10
     public void getBalance(){
10 11
         Wallet wallet= new Wallet(0.0, "Nury H.");
11 12
         //given
12
-       double amount = 100;
13
-       wallet.addMoney(amount);
14
-       //when
13
+        double amount = 100;
14
+        wallet.addMoney(amount);
15
+        //when
15 16
         double actual = wallet.getMoney();
16 17
         //then
17 18
         Assert.assertEquals(amount, actual, 0.0);
18
-
19
-       }
20
-
21
-
19
+    }
22 20
 
23 21
     @Test
24
-    public void testGetId(){
22
+   public void testGetId(){
25 23
         //given
26 24
         Wallet wallet= new Wallet(0.0, "Nury H.");
27 25
         String expected = "Nury H.";
@@ -33,13 +31,11 @@ public class TestWallet {
33 31
 
34 32
     }
35 33
 
36
-
37 34
     @Test
38
-    public void testSetid(){
35
+   public void testSetid(){
39 36
         //given
40 37
         Wallet wallet= new Wallet(0.0, "Nury H.");
41 38
         wallet.setId("Dayhani");
42
-
43 39
         //when
44 40
         String actual = wallet.getId();
45 41
         //then
@@ -61,7 +57,7 @@ public class TestWallet {
61 57
     }
62 58
 
63 59
     @Test
64
-    public void takeMoney(){
60
+   public void takeMoney(){
65 61
         Wallet wallet= new Wallet(230.00, "Nury H.");
66 62
         //given
67 63
         double amount = 75.00;
@@ -72,8 +68,4 @@ public class TestWallet {
72 68
         Assert.assertEquals(155.00, actual, 0.01);
73 69
 
74 70
     }
75
-
76
-
77
-
78
-
79 71
 }