Dev Ghai commited on 2014-04-17 16:55:27
Showing 28 changed files, with 2356 additions and 0 deletions.
... | ... |
@@ -0,0 +1,13 @@ |
1 |
+<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
+<project version="4"> |
|
3 |
+ <component name="ProjectCodeStyleSettingsManager"> |
|
4 |
+ <option name="PER_PROJECT_SETTINGS"> |
|
5 |
+ <value> |
|
6 |
+ <XML> |
|
7 |
+ <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" /> |
|
8 |
+ </XML> |
|
9 |
+ </value> |
|
10 |
+ </option> |
|
11 |
+ </component> |
|
12 |
+</project> |
|
13 |
+ |
... | ... |
@@ -0,0 +1,23 @@ |
1 |
+<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
+<project version="4"> |
|
3 |
+ <component name="CompilerConfiguration"> |
|
4 |
+ <option name="DEFAULT_COMPILER" value="Javac" /> |
|
5 |
+ <resourceExtensions /> |
|
6 |
+ <wildcardResourcePatterns> |
|
7 |
+ <entry name="!?*.java" /> |
|
8 |
+ <entry name="!?*.form" /> |
|
9 |
+ <entry name="!?*.class" /> |
|
10 |
+ <entry name="!?*.groovy" /> |
|
11 |
+ <entry name="!?*.scala" /> |
|
12 |
+ <entry name="!?*.flex" /> |
|
13 |
+ <entry name="!?*.kt" /> |
|
14 |
+ <entry name="!?*.clj" /> |
|
15 |
+ </wildcardResourcePatterns> |
|
16 |
+ <annotationProcessing> |
|
17 |
+ <profile default="true" name="Default" enabled="false"> |
|
18 |
+ <processorPath useClasspath="true" /> |
|
19 |
+ </profile> |
|
20 |
+ </annotationProcessing> |
|
21 |
+ </component> |
|
22 |
+</project> |
|
23 |
+ |
... | ... |
@@ -0,0 +1,26 @@ |
1 |
+<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
+<project version="4"> |
|
3 |
+ <component name="EntryPointsManager"> |
|
4 |
+ <entry_points version="2.0" /> |
|
5 |
+ </component> |
|
6 |
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true"> |
|
7 |
+ <output url="file://$PROJECT_DIR$/out" /> |
|
8 |
+ </component> |
|
9 |
+ <component name="masterDetails"> |
|
10 |
+ <states> |
|
11 |
+ <state key="ProjectJDKs.UI"> |
|
12 |
+ <settings> |
|
13 |
+ <last-edited>Python 2.7.5+ (/usr/bin/python2)</last-edited> |
|
14 |
+ <splitter-proportions> |
|
15 |
+ <option name="proportions"> |
|
16 |
+ <list> |
|
17 |
+ <option value="0.2" /> |
|
18 |
+ </list> |
|
19 |
+ </option> |
|
20 |
+ </splitter-proportions> |
|
21 |
+ </settings> |
|
22 |
+ </state> |
|
23 |
+ </states> |
|
24 |
+ </component> |
|
25 |
+</project> |
|
26 |
+ |
... | ... |
@@ -0,0 +1,1024 @@ |
1 |
+<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
+<project version="4"> |
|
3 |
+ <component name="ChangeListManager"> |
|
4 |
+ <list default="true" id="c3b54428-b280-476a-ab0e-c23a397cf3ed" name="Default" comment="Bug fixes, split dealer from player, refined moves. Dealer needs to be dealt with and efficient win condition evaluation needs to be arrived at."> |
|
5 |
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../ListDuplicate/ListDuplicate/obj/x86/Debug/BungieCore.exe" afterPath="$PROJECT_DIR$/../ListDuplicate/ListDuplicate/obj/x86/Debug/BungieCore.exe" /> |
|
6 |
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../ListDuplicate/ListDuplicate/obj/x86/Debug/BungieCore.pdb" afterPath="$PROJECT_DIR$/../ListDuplicate/ListDuplicate/obj/x86/Debug/BungieCore.pdb" /> |
|
7 |
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../ListDuplicate/ListDuplicate/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache" afterPath="$PROJECT_DIR$/../ListDuplicate/ListDuplicate/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache" /> |
|
8 |
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../MenuParser-php/GetCheapestRestaurant" afterPath="$PROJECT_DIR$/../MenuParser-php/GetCheapestRestaurant" /> |
|
9 |
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../ListDuplicate/ListDuplicate/obj/x86/Debug/ListDuplicate.csproj.FileListAbsolute.txt" afterPath="$PROJECT_DIR$/../ListDuplicate/ListDuplicate/obj/x86/Debug/ListDuplicate.csproj.FileListAbsolute.txt" /> |
|
10 |
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../ListDuplicate/ListDuplicate.sln" afterPath="$PROJECT_DIR$/../ListDuplicate/ListDuplicate.sln" /> |
|
11 |
+ </list> |
|
12 |
+ <ignored path="blackjack.iws" /> |
|
13 |
+ <ignored path=".idea/workspace.xml" /> |
|
14 |
+ <option name="TRACKING_ENABLED" value="true" /> |
|
15 |
+ <option name="SHOW_DIALOG" value="false" /> |
|
16 |
+ <option name="HIGHLIGHT_CONFLICTS" value="true" /> |
|
17 |
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> |
|
18 |
+ <option name="LAST_RESOLUTION" value="IGNORE" /> |
|
19 |
+ </component> |
|
20 |
+ <component name="ChangesViewManager" flattened_view="true" show_ignored="false" /> |
|
21 |
+ <component name="CreatePatchCommitExecutor"> |
|
22 |
+ <option name="PATCH_PATH" value="" /> |
|
23 |
+ </component> |
|
24 |
+ <component name="DaemonCodeAnalyzer"> |
|
25 |
+ <disable_hints /> |
|
26 |
+ </component> |
|
27 |
+ <component name="DebuggerManager"> |
|
28 |
+ <ui_properties default_suspend_policy="SuspendAll" default_condition_enabled="true" /> |
|
29 |
+ <breakpoint_any default_suspend_policy="SuspendAll" default_condition_enabled="true"> |
|
30 |
+ <breakpoint> |
|
31 |
+ <option name="NOTIFY_CAUGHT" value="true" /> |
|
32 |
+ <option name="NOTIFY_UNCAUGHT" value="true" /> |
|
33 |
+ <option name="ENABLED" value="false" /> |
|
34 |
+ <option name="LOG_ENABLED" value="false" /> |
|
35 |
+ <option name="LOG_EXPRESSION_ENABLED" value="false" /> |
|
36 |
+ <option name="REMOVE_AFTER_HIT" value="false" /> |
|
37 |
+ <option name="SUSPEND_POLICY" value="SuspendAll" /> |
|
38 |
+ <option name="SUSPEND" value="true" /> |
|
39 |
+ <option name="COUNT_FILTER_ENABLED" value="false" /> |
|
40 |
+ <option name="COUNT_FILTER" value="0" /> |
|
41 |
+ <option name="CONDITION_ENABLED" value="true" /> |
|
42 |
+ <option name="CLASS_FILTERS_ENABLED" value="false" /> |
|
43 |
+ <option name="INSTANCE_FILTERS_ENABLED" value="false" /> |
|
44 |
+ <option name="CONDITION" value="" /> |
|
45 |
+ <option name="LOG_MESSAGE" value="" /> |
|
46 |
+ </breakpoint> |
|
47 |
+ <breakpoint> |
|
48 |
+ <option name="NOTIFY_CAUGHT" value="true" /> |
|
49 |
+ <option name="NOTIFY_UNCAUGHT" value="true" /> |
|
50 |
+ <option name="ENABLED" value="false" /> |
|
51 |
+ <option name="LOG_ENABLED" value="false" /> |
|
52 |
+ <option name="LOG_EXPRESSION_ENABLED" value="false" /> |
|
53 |
+ <option name="REMOVE_AFTER_HIT" value="false" /> |
|
54 |
+ <option name="SUSPEND_POLICY" value="SuspendAll" /> |
|
55 |
+ <option name="SUSPEND" value="true" /> |
|
56 |
+ <option name="COUNT_FILTER_ENABLED" value="false" /> |
|
57 |
+ <option name="COUNT_FILTER" value="0" /> |
|
58 |
+ <option name="CONDITION_ENABLED" value="true" /> |
|
59 |
+ <option name="CLASS_FILTERS_ENABLED" value="false" /> |
|
60 |
+ <option name="INSTANCE_FILTERS_ENABLED" value="false" /> |
|
61 |
+ <option name="CONDITION" value="" /> |
|
62 |
+ <option name="LOG_MESSAGE" value="" /> |
|
63 |
+ </breakpoint> |
|
64 |
+ </breakpoint_any> |
|
65 |
+ <breakpoint_rules /> |
|
66 |
+ <ui_properties /> |
|
67 |
+ </component> |
|
68 |
+ <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" /> |
|
69 |
+ <component name="FavoritesManager"> |
|
70 |
+ <favorites_list name="blackjack" /> |
|
71 |
+ </component> |
|
72 |
+ <component name="FileEditorManager"> |
|
73 |
+ <leaf> |
|
74 |
+ <file leaf-file-name="Blackjack.php" pinned="false" current="true" current-in-tab="true"> |
|
75 |
+ <entry file="file://$PROJECT_DIR$/Blackjack.php"> |
|
76 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
77 |
+ <state line="118" column="52" selection-start="3259" selection-end="3259" vertical-scroll-proportion="0.46092865" vertical-offset="1446" max-vertical-offset="2329"> |
|
78 |
+ <folding /> |
|
79 |
+ </state> |
|
80 |
+ </provider> |
|
81 |
+ </entry> |
|
82 |
+ </file> |
|
83 |
+ <file leaf-file-name="Error.php" pinned="false" current="false" current-in-tab="false"> |
|
84 |
+ <entry file="file://$PROJECT_DIR$/Objects/Error.php"> |
|
85 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
86 |
+ <state line="54" column="82" selection-start="2312" selection-end="2312" vertical-scroll-proportion="-31.346153" vertical-offset="35" max-vertical-offset="1785"> |
|
87 |
+ <folding /> |
|
88 |
+ </state> |
|
89 |
+ </provider> |
|
90 |
+ </entry> |
|
91 |
+ </file> |
|
92 |
+ <file leaf-file-name="Player.php" pinned="false" current="false" current-in-tab="false"> |
|
93 |
+ <entry file="file://$PROJECT_DIR$/Objects/Player.php"> |
|
94 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
95 |
+ <state line="11" column="0" selection-start="122" selection-end="122" vertical-scroll-proportion="-4.576923" vertical-offset="0" max-vertical-offset="1751"> |
|
96 |
+ <folding /> |
|
97 |
+ </state> |
|
98 |
+ </provider> |
|
99 |
+ </entry> |
|
100 |
+ </file> |
|
101 |
+ <file leaf-file-name="Hand.php" pinned="false" current="false" current-in-tab="false"> |
|
102 |
+ <entry file="file://$PROJECT_DIR$/Objects/Hand.php"> |
|
103 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
104 |
+ <state line="138" column="29" selection-start="3884" selection-end="3884" vertical-scroll-proportion="-87.61539" vertical-offset="0" max-vertical-offset="3043"> |
|
105 |
+ <folding /> |
|
106 |
+ </state> |
|
107 |
+ </provider> |
|
108 |
+ </entry> |
|
109 |
+ </file> |
|
110 |
+ <file leaf-file-name="PlayerBase.php" pinned="false" current="false" current-in-tab="false"> |
|
111 |
+ <entry file="file://$PROJECT_DIR$/Objects/PlayerBase.php"> |
|
112 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
113 |
+ <state line="54" column="0" selection-start="1142" selection-end="1142" vertical-scroll-proportion="-28.73077" vertical-offset="103" max-vertical-offset="986"> |
|
114 |
+ <folding /> |
|
115 |
+ </state> |
|
116 |
+ </provider> |
|
117 |
+ </entry> |
|
118 |
+ </file> |
|
119 |
+ <file leaf-file-name="Dealer.php" pinned="false" current="false" current-in-tab="false"> |
|
120 |
+ <entry file="file://$PROJECT_DIR$/Objects/Dealer.php"> |
|
121 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
122 |
+ <state line="45" column="15" selection-start="981" selection-end="981" vertical-scroll-proportion="-26.807692" vertical-offset="0" max-vertical-offset="833"> |
|
123 |
+ <folding /> |
|
124 |
+ </state> |
|
125 |
+ </provider> |
|
126 |
+ </entry> |
|
127 |
+ </file> |
|
128 |
+ <file leaf-file-name="Config.php" pinned="false" current="false" current-in-tab="false"> |
|
129 |
+ <entry file="file://$PROJECT_DIR$/Config/Config.php"> |
|
130 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
131 |
+ <state line="18" column="84" selection-start="575" selection-end="575" vertical-scroll-proportion="-9.153846" vertical-offset="0" max-vertical-offset="680"> |
|
132 |
+ <folding /> |
|
133 |
+ </state> |
|
134 |
+ </provider> |
|
135 |
+ </entry> |
|
136 |
+ </file> |
|
137 |
+ <file leaf-file-name="Response.php" pinned="false" current="false" current-in-tab="false"> |
|
138 |
+ <entry file="file://$PROJECT_DIR$/Objects/Response.php"> |
|
139 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
140 |
+ <state line="19" column="46" selection-start="365" selection-end="365" vertical-scroll-proportion="-9.807693" vertical-offset="0" max-vertical-offset="391"> |
|
141 |
+ <folding /> |
|
142 |
+ </state> |
|
143 |
+ </provider> |
|
144 |
+ </entry> |
|
145 |
+ </file> |
|
146 |
+ <file leaf-file-name="Deck.php" pinned="false" current="false" current-in-tab="false"> |
|
147 |
+ <entry file="file://$PROJECT_DIR$/Objects/Deck.php"> |
|
148 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
149 |
+ <state line="52" column="17" selection-start="1481" selection-end="1481" vertical-scroll-proportion="-31.384615" vertical-offset="0" max-vertical-offset="1598"> |
|
150 |
+ <folding /> |
|
151 |
+ </state> |
|
152 |
+ </provider> |
|
153 |
+ </entry> |
|
154 |
+ </file> |
|
155 |
+ <file leaf-file-name="index.php" pinned="false" current="false" current-in-tab="false"> |
|
156 |
+ <entry file="file://$PROJECT_DIR$/index.php"> |
|
157 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
158 |
+ <state line="105" column="82" selection-start="3829" selection-end="3829" vertical-scroll-proportion="-68.65385" vertical-offset="0" max-vertical-offset="2533"> |
|
159 |
+ <folding> |
|
160 |
+ <element signature="n#Debug#0;n#!!top" expanded="true" /> |
|
161 |
+ <element signature="n#ValidateSession#0;n#!!top" expanded="true" /> |
|
162 |
+ </folding> |
|
163 |
+ </state> |
|
164 |
+ </provider> |
|
165 |
+ </entry> |
|
166 |
+ </file> |
|
167 |
+ </leaf> |
|
168 |
+ </component> |
|
169 |
+ <component name="FindManager"> |
|
170 |
+ <FindUsagesManager> |
|
171 |
+ <setting name="OPEN_NEW_TAB" value="false" /> |
|
172 |
+ </FindUsagesManager> |
|
173 |
+ </component> |
|
174 |
+ <component name="Git.Settings"> |
|
175 |
+ <option name="PREVIOUS_COMMIT_AUTHORS"> |
|
176 |
+ <list> |
|
177 |
+ <option value="Dev Ghai" /> |
|
178 |
+ </list> |
|
179 |
+ </option> |
|
180 |
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." /> |
|
181 |
+ </component> |
|
182 |
+ <component name="GitLogSettings"> |
|
183 |
+ <option name="myDateState"> |
|
184 |
+ <MyDateState /> |
|
185 |
+ </option> |
|
186 |
+ </component> |
|
187 |
+ <component name="IdeDocumentHistory"> |
|
188 |
+ <option name="changedFiles"> |
|
189 |
+ <list> |
|
190 |
+ <option value="$PROJECT_DIR$/Objects/Card.php" /> |
|
191 |
+ <option value="$PROJECT_DIR$/UI/form.html" /> |
|
192 |
+ <option value="$PROJECT_DIR$/UI/name.html" /> |
|
193 |
+ <option value="$PROJECT_DIR$/UI/style/bjstyles.css" /> |
|
194 |
+ <option value="$PROJECT_DIR$/UI/name.php" /> |
|
195 |
+ <option value="$PROJECT_DIR$/UI/table.php" /> |
|
196 |
+ <option value="/mnt/docs/src/interviews/Blackjack/index.php" /> |
|
197 |
+ <option value="$PROJECT_DIR$/Objects/Deck.php" /> |
|
198 |
+ <option value="$PROJECT_DIR$/Config/Config.php" /> |
|
199 |
+ <option value="$PROJECT_DIR$/Objects/Shoe.php" /> |
|
200 |
+ <option value="$PROJECT_DIR$/Objects/Player.php" /> |
|
201 |
+ <option value="$PROJECT_DIR$/Objects/Error.php" /> |
|
202 |
+ <option value="$PROJECT_DIR$/Objects/PlayerBase.php" /> |
|
203 |
+ <option value="$PROJECT_DIR$/Objects/Dealer.php" /> |
|
204 |
+ <option value="$PROJECT_DIR$/Objects/Hand.php" /> |
|
205 |
+ <option value="$PROJECT_DIR$/Objects/Response.php" /> |
|
206 |
+ <option value="$PROJECT_DIR$/Blackjack.php" /> |
|
207 |
+ <option value="$PROJECT_DIR$/index.php" /> |
|
208 |
+ </list> |
|
209 |
+ </option> |
|
210 |
+ </component> |
|
211 |
+ <component name="PhpServers"> |
|
212 |
+ <option name="servers"> |
|
213 |
+ <server host="blackjack" name="localhost" use_path_mappings="true"> |
|
214 |
+ <path_mappings> |
|
215 |
+ <path_mapping local_path="$PROJECT_DIR$" remote_path="/mnt/docs/src/interviews/Blackjack" /> |
|
216 |
+ </path_mappings> |
|
217 |
+ </server> |
|
218 |
+ </option> |
|
219 |
+ </component> |
|
220 |
+ <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" /> |
|
221 |
+ <component name="ProjectFrameBounds"> |
|
222 |
+ <option name="x" value="-2" /> |
|
223 |
+ <option name="y" value="-3" /> |
|
224 |
+ <option name="width" value="1924" /> |
|
225 |
+ <option name="height" value="1054" /> |
|
226 |
+ </component> |
|
227 |
+ <component name="ProjectLevelVcsManager" settingsEditedManually="true"> |
|
228 |
+ <OptionsSetting value="true" id="Add" /> |
|
229 |
+ <OptionsSetting value="true" id="Remove" /> |
|
230 |
+ <OptionsSetting value="true" id="Checkout" /> |
|
231 |
+ <OptionsSetting value="true" id="Update" /> |
|
232 |
+ <OptionsSetting value="true" id="Status" /> |
|
233 |
+ <OptionsSetting value="true" id="Edit" /> |
|
234 |
+ <ConfirmationsSetting value="0" id="Add" /> |
|
235 |
+ <ConfirmationsSetting value="0" id="Remove" /> |
|
236 |
+ </component> |
|
237 |
+ <component name="ProjectReloadState"> |
|
238 |
+ <option name="STATE" value="0" /> |
|
239 |
+ </component> |
|
240 |
+ <component name="ProjectView"> |
|
241 |
+ <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5"> |
|
242 |
+ <flattenPackages /> |
|
243 |
+ <showMembers /> |
|
244 |
+ <showModules /> |
|
245 |
+ <showLibraryContents /> |
|
246 |
+ <hideEmptyPackages /> |
|
247 |
+ <abbreviatePackageNames /> |
|
248 |
+ <autoscrollToSource /> |
|
249 |
+ <autoscrollFromSource /> |
|
250 |
+ <sortByType /> |
|
251 |
+ </navigator> |
|
252 |
+ <panes> |
|
253 |
+ <pane id="PackagesPane" /> |
|
254 |
+ <pane id="Scope" /> |
|
255 |
+ <pane id="ProjectPane"> |
|
256 |
+ <subPane> |
|
257 |
+ <PATH> |
|
258 |
+ <PATH_ELEMENT> |
|
259 |
+ <option name="myItemId" value="blackjack" /> |
|
260 |
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> |
|
261 |
+ </PATH_ELEMENT> |
|
262 |
+ </PATH> |
|
263 |
+ <PATH> |
|
264 |
+ <PATH_ELEMENT> |
|
265 |
+ <option name="myItemId" value="blackjack" /> |
|
266 |
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> |
|
267 |
+ </PATH_ELEMENT> |
|
268 |
+ <PATH_ELEMENT> |
|
269 |
+ <option name="myItemId" value="Blackjack" /> |
|
270 |
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> |
|
271 |
+ </PATH_ELEMENT> |
|
272 |
+ </PATH> |
|
273 |
+ <PATH> |
|
274 |
+ <PATH_ELEMENT> |
|
275 |
+ <option name="myItemId" value="blackjack" /> |
|
276 |
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> |
|
277 |
+ </PATH_ELEMENT> |
|
278 |
+ <PATH_ELEMENT> |
|
279 |
+ <option name="myItemId" value="Blackjack" /> |
|
280 |
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> |
|
281 |
+ </PATH_ELEMENT> |
|
282 |
+ <PATH_ELEMENT> |
|
283 |
+ <option name="myItemId" value="Objects" /> |
|
284 |
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> |
|
285 |
+ </PATH_ELEMENT> |
|
286 |
+ </PATH> |
|
287 |
+ <PATH> |
|
288 |
+ <PATH_ELEMENT> |
|
289 |
+ <option name="myItemId" value="blackjack" /> |
|
290 |
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> |
|
291 |
+ </PATH_ELEMENT> |
|
292 |
+ <PATH_ELEMENT> |
|
293 |
+ <option name="myItemId" value="Blackjack" /> |
|
294 |
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> |
|
295 |
+ </PATH_ELEMENT> |
|
296 |
+ <PATH_ELEMENT> |
|
297 |
+ <option name="myItemId" value="Config" /> |
|
298 |
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> |
|
299 |
+ </PATH_ELEMENT> |
|
300 |
+ </PATH> |
|
301 |
+ </subPane> |
|
302 |
+ </pane> |
|
303 |
+ </panes> |
|
304 |
+ </component> |
|
305 |
+ <component name="PropertiesComponent"> |
|
306 |
+ <property name="GoToFile.includeJavaFiles" value="false" /> |
|
307 |
+ <property name="options.splitter.main.proportions" value="0.3" /> |
|
308 |
+ <property name="recentsLimit" value="5" /> |
|
309 |
+ <property name="MemberChooser.sorted" value="false" /> |
|
310 |
+ <property name="options.lastSelected" value="editor.preferences.completion" /> |
|
311 |
+ <property name="last_opened_file_path" value="$PROJECT_DIR$/../../vroom360" /> |
|
312 |
+ <property name="DefaultHtmlFileTemplate" value="Html5" /> |
|
313 |
+ <property name="MemberChooser.copyJavadoc" value="false" /> |
|
314 |
+ <property name="GoToClass.toSaveIncludeLibraries" value="false" /> |
|
315 |
+ <property name="WebServerToolWindowFactoryState" value="true" /> |
|
316 |
+ <property name="restartRequiresConfirmation" value="true" /> |
|
317 |
+ <property name="MemberChooser.showClasses" value="true" /> |
|
318 |
+ <property name="GoToClass.includeLibraries" value="false" /> |
|
319 |
+ <property name="options.splitter.details.proportions" value="0.2" /> |
|
320 |
+ <property name="options.searchVisible" value="true" /> |
|
321 |
+ <property name="FullScreen" value="false" /> |
|
322 |
+ <property name="SearchEverywhereHistory" value=" $" /> |
|
323 |
+ </component> |
|
324 |
+ <component name="PyConsoleOptionsProvider"> |
|
325 |
+ <option name="myPythonConsoleState"> |
|
326 |
+ <console-settings /> |
|
327 |
+ </option> |
|
328 |
+ </component> |
|
329 |
+ <component name="RunManager" selected="PHP Web Application.blackjack"> |
|
330 |
+ <configuration default="true" type="DjangoTestsConfigurationType" factoryName="Django tests"> |
|
331 |
+ <option name="INTERPRETER_OPTIONS" value="" /> |
|
332 |
+ <option name="PARENT_ENVS" value="true" /> |
|
333 |
+ <envs> |
|
334 |
+ <env name="PYTHONUNBUFFERED" value="1" /> |
|
335 |
+ </envs> |
|
336 |
+ <option name="SDK_HOME" value="" /> |
|
337 |
+ <option name="WORKING_DIRECTORY" value="" /> |
|
338 |
+ <option name="IS_MODULE_SDK" value="false" /> |
|
339 |
+ <option name="ADD_CONTENT_ROOTS" value="true" /> |
|
340 |
+ <option name="ADD_SOURCE_ROOTS" value="true" /> |
|
341 |
+ <module name="Blackjack" /> |
|
342 |
+ <EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" /> |
|
343 |
+ <option name="TARGET" value="" /> |
|
344 |
+ <option name="SETTINGS_FILE" value="" /> |
|
345 |
+ <option name="CUSTOM_SETTINGS" value="false" /> |
|
346 |
+ <option name="USE_OPTIONS" value="false" /> |
|
347 |
+ <option name="OPTIONS" value="" /> |
|
348 |
+ <method /> |
|
349 |
+ </configuration> |
|
350 |
+ <configuration default="true" type="PhpWebAppRunConfigurationType" factoryName="PHP Web Application"> |
|
351 |
+ <method /> |
|
352 |
+ </configuration> |
|
353 |
+ <configuration default="true" type="tests" factoryName="py.test"> |
|
354 |
+ <option name="INTERPRETER_OPTIONS" value="" /> |
|
355 |
+ <option name="PARENT_ENVS" value="true" /> |
|
356 |
+ <envs /> |
|
357 |
+ <option name="SDK_HOME" value="" /> |
|
358 |
+ <option name="WORKING_DIRECTORY" value="" /> |
|
359 |
+ <option name="IS_MODULE_SDK" value="false" /> |
|
360 |
+ <option name="ADD_CONTENT_ROOTS" value="true" /> |
|
361 |
+ <option name="ADD_SOURCE_ROOTS" value="true" /> |
|
362 |
+ <module name="Blackjack" /> |
|
363 |
+ <EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" /> |
|
364 |
+ <option name="SCRIPT_NAME" value="" /> |
|
365 |
+ <option name="CLASS_NAME" value="" /> |
|
366 |
+ <option name="METHOD_NAME" value="" /> |
|
367 |
+ <option name="FOLDER_NAME" value="" /> |
|
368 |
+ <option name="TEST_TYPE" value="TEST_SCRIPT" /> |
|
369 |
+ <option name="PATTERN" value="" /> |
|
370 |
+ <option name="USE_PATTERN" value="false" /> |
|
371 |
+ <option name="testToRun" value="" /> |
|
372 |
+ <option name="keywords" value="" /> |
|
373 |
+ <option name="params" value="" /> |
|
374 |
+ <option name="USE_PARAM" value="false" /> |
|
375 |
+ <option name="USE_KEYWORD" value="false" /> |
|
376 |
+ <method /> |
|
377 |
+ </configuration> |
|
378 |
+ <configuration default="true" type="tests" factoryName="Nosetests"> |
|
379 |
+ <option name="INTERPRETER_OPTIONS" value="" /> |
|
380 |
+ <option name="PARENT_ENVS" value="true" /> |
|
381 |
+ <envs /> |
|
382 |
+ <option name="SDK_HOME" value="" /> |
|
383 |
+ <option name="WORKING_DIRECTORY" value="" /> |
|
384 |
+ <option name="IS_MODULE_SDK" value="false" /> |
|
385 |
+ <option name="ADD_CONTENT_ROOTS" value="true" /> |
|
386 |
+ <option name="ADD_SOURCE_ROOTS" value="true" /> |
|
387 |
+ <module name="Blackjack" /> |
|
388 |
+ <EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" /> |
|
389 |
+ <option name="SCRIPT_NAME" value="" /> |
|
390 |
+ <option name="CLASS_NAME" value="" /> |
|
391 |
+ <option name="METHOD_NAME" value="" /> |
|
392 |
+ <option name="FOLDER_NAME" value="" /> |
|
393 |
+ <option name="TEST_TYPE" value="TEST_SCRIPT" /> |
|
394 |
+ <option name="PATTERN" value="" /> |
|
395 |
+ <option name="USE_PATTERN" value="false" /> |
|
396 |
+ <option name="PARAMS" value="" /> |
|
397 |
+ <option name="USE_PARAM" value="false" /> |
|
398 |
+ <method /> |
|
399 |
+ </configuration> |
|
400 |
+ <configuration default="true" type="Remote" factoryName="Remote"> |
|
401 |
+ <option name="USE_SOCKET_TRANSPORT" value="true" /> |
|
402 |
+ <option name="SERVER_MODE" value="false" /> |
|
403 |
+ <option name="SHMEM_ADDRESS" value="javadebug" /> |
|
404 |
+ <option name="HOST" value="localhost" /> |
|
405 |
+ <option name="PORT" value="5005" /> |
|
406 |
+ <method /> |
|
407 |
+ </configuration> |
|
408 |
+ <configuration default="true" type="PhpLocalRunConfigurationType" factoryName="PHP Console"> |
|
409 |
+ <method /> |
|
410 |
+ </configuration> |
|
411 |
+ <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug" singleton="true"> |
|
412 |
+ <method /> |
|
413 |
+ </configuration> |
|
414 |
+ <configuration default="true" type="Applet" factoryName="Applet"> |
|
415 |
+ <module name="" /> |
|
416 |
+ <option name="MAIN_CLASS_NAME" /> |
|
417 |
+ <option name="HTML_FILE_NAME" /> |
|
418 |
+ <option name="HTML_USED" value="false" /> |
|
419 |
+ <option name="WIDTH" value="400" /> |
|
420 |
+ <option name="HEIGHT" value="300" /> |
|
421 |
+ <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" /> |
|
422 |
+ <option name="VM_PARAMETERS" /> |
|
423 |
+ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" /> |
|
424 |
+ <option name="ALTERNATIVE_JRE_PATH" /> |
|
425 |
+ <method /> |
|
426 |
+ </configuration> |
|
427 |
+ <configuration default="true" type="tests" factoryName="Doctests"> |
|
428 |
+ <option name="INTERPRETER_OPTIONS" value="" /> |
|
429 |
+ <option name="PARENT_ENVS" value="true" /> |
|
430 |
+ <envs /> |
|
431 |
+ <option name="SDK_HOME" value="" /> |
|
432 |
+ <option name="WORKING_DIRECTORY" value="" /> |
|
433 |
+ <option name="IS_MODULE_SDK" value="false" /> |
|
434 |
+ <option name="ADD_CONTENT_ROOTS" value="true" /> |
|
435 |
+ <option name="ADD_SOURCE_ROOTS" value="true" /> |
|
436 |
+ <module name="Blackjack" /> |
|
437 |
+ <EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" /> |
|
438 |
+ <option name="SCRIPT_NAME" value="" /> |
|
439 |
+ <option name="CLASS_NAME" value="" /> |
|
440 |
+ <option name="METHOD_NAME" value="" /> |
|
441 |
+ <option name="FOLDER_NAME" value="" /> |
|
442 |
+ <option name="TEST_TYPE" value="TEST_SCRIPT" /> |
|
443 |
+ <option name="PATTERN" value="" /> |
|
444 |
+ <option name="USE_PATTERN" value="false" /> |
|
445 |
+ <method /> |
|
446 |
+ </configuration> |
|
447 |
+ <configuration default="true" type="PhpUnitRemoteRunConfigurationType" factoryName="PHPUnit on Server"> |
|
448 |
+ <method /> |
|
449 |
+ </configuration> |
|
450 |
+ <configuration default="true" type="PHPUnitRunConfigurationType" factoryName="PHPUnit"> |
|
451 |
+ <TestRunner /> |
|
452 |
+ <method /> |
|
453 |
+ </configuration> |
|
454 |
+ <configuration default="true" type="PythonConfigurationType" factoryName="Python"> |
|
455 |
+ <option name="INTERPRETER_OPTIONS" value="" /> |
|
456 |
+ <option name="PARENT_ENVS" value="true" /> |
|
457 |
+ <envs> |
|
458 |
+ <env name="PYTHONUNBUFFERED" value="1" /> |
|
459 |
+ </envs> |
|
460 |
+ <option name="SDK_HOME" value="" /> |
|
461 |
+ <option name="WORKING_DIRECTORY" value="" /> |
|
462 |
+ <option name="IS_MODULE_SDK" value="false" /> |
|
463 |
+ <option name="ADD_CONTENT_ROOTS" value="true" /> |
|
464 |
+ <option name="ADD_SOURCE_ROOTS" value="true" /> |
|
465 |
+ <module name="Blackjack" /> |
|
466 |
+ <EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" /> |
|
467 |
+ <option name="SCRIPT_NAME" value="" /> |
|
468 |
+ <option name="PARAMETERS" value="" /> |
|
469 |
+ <method /> |
|
470 |
+ </configuration> |
|
471 |
+ <configuration default="true" type="tests" factoryName="Unittests"> |
|
472 |
+ <option name="INTERPRETER_OPTIONS" value="" /> |
|
473 |
+ <option name="PARENT_ENVS" value="true" /> |
|
474 |
+ <envs /> |
|
475 |
+ <option name="SDK_HOME" value="" /> |
|
476 |
+ <option name="WORKING_DIRECTORY" value="" /> |
|
477 |
+ <option name="IS_MODULE_SDK" value="false" /> |
|
478 |
+ <option name="ADD_CONTENT_ROOTS" value="true" /> |
|
479 |
+ <option name="ADD_SOURCE_ROOTS" value="true" /> |
|
480 |
+ <module name="Blackjack" /> |
|
481 |
+ <EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" /> |
|
482 |
+ <option name="SCRIPT_NAME" value="" /> |
|
483 |
+ <option name="CLASS_NAME" value="" /> |
|
484 |
+ <option name="METHOD_NAME" value="" /> |
|
485 |
+ <option name="FOLDER_NAME" value="" /> |
|
486 |
+ <option name="TEST_TYPE" value="TEST_SCRIPT" /> |
|
487 |
+ <option name="PATTERN" value="" /> |
|
488 |
+ <option name="USE_PATTERN" value="false" /> |
|
489 |
+ <option name="PUREUNITTEST" value="true" /> |
|
490 |
+ <option name="PARAMS" value="" /> |
|
491 |
+ <option name="USE_PARAM" value="false" /> |
|
492 |
+ <method /> |
|
493 |
+ </configuration> |
|
494 |
+ <configuration default="true" type="Application" factoryName="Application"> |
|
495 |
+ <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" /> |
|
496 |
+ <option name="MAIN_CLASS_NAME" /> |
|
497 |
+ <option name="VM_PARAMETERS" /> |
|
498 |
+ <option name="PROGRAM_PARAMETERS" /> |
|
499 |
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> |
|
500 |
+ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" /> |
|
501 |
+ <option name="ALTERNATIVE_JRE_PATH" /> |
|
502 |
+ <option name="ENABLE_SWING_INSPECTOR" value="false" /> |
|
503 |
+ <option name="ENV_VARIABLES" /> |
|
504 |
+ <option name="PASS_PARENT_ENVS" value="true" /> |
|
505 |
+ <module name="" /> |
|
506 |
+ <envs /> |
|
507 |
+ <method /> |
|
508 |
+ </configuration> |
|
509 |
+ <configuration default="true" type="tests" factoryName="Attests"> |
|
510 |
+ <option name="INTERPRETER_OPTIONS" value="" /> |
|
511 |
+ <option name="PARENT_ENVS" value="true" /> |
|
512 |
+ <envs /> |
|
513 |
+ <option name="SDK_HOME" value="" /> |
|
514 |
+ <option name="WORKING_DIRECTORY" value="" /> |
|
515 |
+ <option name="IS_MODULE_SDK" value="false" /> |
|
516 |
+ <option name="ADD_CONTENT_ROOTS" value="true" /> |
|
517 |
+ <option name="ADD_SOURCE_ROOTS" value="true" /> |
|
518 |
+ <module name="Blackjack" /> |
|
519 |
+ <EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" /> |
|
520 |
+ <option name="SCRIPT_NAME" value="" /> |
|
521 |
+ <option name="CLASS_NAME" value="" /> |
|
522 |
+ <option name="METHOD_NAME" value="" /> |
|
523 |
+ <option name="FOLDER_NAME" value="" /> |
|
524 |
+ <option name="TEST_TYPE" value="TEST_SCRIPT" /> |
|
525 |
+ <option name="PATTERN" value="" /> |
|
526 |
+ <option name="USE_PATTERN" value="false" /> |
|
527 |
+ <method /> |
|
528 |
+ </configuration> |
|
529 |
+ <configuration default="false" name="blackjack" type="PhpWebAppRunConfigurationType" factoryName="PHP Web Application" browser="FIREFOX" server_name="localhost"> |
|
530 |
+ <RunnerSettings RunnerId="PhpWebAppDebugRunner" /> |
|
531 |
+ <ConfigurationWrapper RunnerId="PhpWebAppDebugRunner" /> |
|
532 |
+ <method /> |
|
533 |
+ </configuration> |
|
534 |
+ <list size="1"> |
|
535 |
+ <item index="0" class="java.lang.String" itemvalue="PHP Web Application.blackjack" /> |
|
536 |
+ </list> |
|
537 |
+ <configuration name="<template>" type="JUnit" default="true" selected="false"> |
|
538 |
+ <option name="MAIN_CLASS_NAME" /> |
|
539 |
+ <option name="VM_PARAMETERS" value="-ea" /> |
|
540 |
+ <option name="PARAMETERS" /> |
|
541 |
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> |
|
542 |
+ </configuration> |
|
543 |
+ <configuration name="<template>" type="TestNG" default="true" selected="false"> |
|
544 |
+ <option name="MAIN_CLASS_NAME" /> |
|
545 |
+ <option name="VM_PARAMETERS" value="-ea" /> |
|
546 |
+ <option name="PARAMETERS" /> |
|
547 |
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> |
|
548 |
+ </configuration> |
|
549 |
+ <configuration name="<template>" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" default="true" selected="false"> |
|
550 |
+ <option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m" /> |
|
551 |
+ </configuration> |
|
552 |
+ <configuration name="<template>" type="WebApp" default="true" selected="false"> |
|
553 |
+ <Host>localhost</Host> |
|
554 |
+ <Port>5050</Port> |
|
555 |
+ </configuration> |
|
556 |
+ </component> |
|
557 |
+ <component name="ShelveChangesManager" show_recycled="false" /> |
|
558 |
+ <component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="false" SSL_PROTOCOLS="all"> |
|
559 |
+ <option name="USER" value="" /> |
|
560 |
+ <option name="PASSWORD" value="" /> |
|
561 |
+ <option name="mySSHConnectionTimeout" value="30000" /> |
|
562 |
+ <option name="mySSHReadTimeout" value="30000" /> |
|
563 |
+ <option name="LAST_MERGED_REVISION" /> |
|
564 |
+ <option name="MERGE_DRY_RUN" value="false" /> |
|
565 |
+ <option name="MERGE_DIFF_USE_ANCESTRY" value="true" /> |
|
566 |
+ <option name="UPDATE_LOCK_ON_DEMAND" value="false" /> |
|
567 |
+ <option name="IGNORE_SPACES_IN_MERGE" value="false" /> |
|
568 |
+ <option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" /> |
|
569 |
+ <option name="IGNORE_SPACES_IN_ANNOTATE" value="true" /> |
|
570 |
+ <option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" /> |
|
571 |
+ <option name="FORCE_UPDATE" value="false" /> |
|
572 |
+ <option name="IGNORE_EXTERNALS" value="false" /> |
|
573 |
+ <myIsUseDefaultProxy>false</myIsUseDefaultProxy> |
|
574 |
+ </component> |
|
575 |
+ <component name="TodoView" selected-index="0"> |
|
576 |
+ <todo-panel id="selected-file"> |
|
577 |
+ <are-packages-shown value="false" /> |
|
578 |
+ <are-modules-shown value="false" /> |
|
579 |
+ <flatten-packages value="false" /> |
|
580 |
+ <is-autoscroll-to-source value="true" /> |
|
581 |
+ </todo-panel> |
|
582 |
+ <todo-panel id="all"> |
|
583 |
+ <are-packages-shown value="true" /> |
|
584 |
+ <are-modules-shown value="false" /> |
|
585 |
+ <flatten-packages value="false" /> |
|
586 |
+ <is-autoscroll-to-source value="true" /> |
|
587 |
+ </todo-panel> |
|
588 |
+ <todo-panel id="default-changelist"> |
|
589 |
+ <are-packages-shown value="false" /> |
|
590 |
+ <are-modules-shown value="false" /> |
|
591 |
+ <flatten-packages value="false" /> |
|
592 |
+ <is-autoscroll-to-source value="false" /> |
|
593 |
+ </todo-panel> |
|
594 |
+ </component> |
|
595 |
+ <component name="ToolWindowManager"> |
|
596 |
+ <frame x="-2" y="-3" width="1924" height="1054" extended-state="6" /> |
|
597 |
+ <editor active="true" /> |
|
598 |
+ <layout> |
|
599 |
+ <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32938644" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> |
|
600 |
+ <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> |
|
601 |
+ <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32938644" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" /> |
|
602 |
+ <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32905984" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> |
|
603 |
+ <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> |
|
604 |
+ <window_info id="Remote Host" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> |
|
605 |
+ <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.39636752" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> |
|
606 |
+ <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" /> |
|
607 |
+ <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> |
|
608 |
+ <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> |
|
609 |
+ <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32938644" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" /> |
|
610 |
+ <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32938644" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> |
|
611 |
+ <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.18956336" sideWeight="0.6013289" order="1" side_tool="false" content_ui="tabs" /> |
|
612 |
+ <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" /> |
|
613 |
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.16932908" sideWeight="0.60044396" order="0" side_tool="false" content_ui="combo" /> |
|
614 |
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> |
|
615 |
+ <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> |
|
616 |
+ <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> |
|
617 |
+ <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> |
|
618 |
+ <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> |
|
619 |
+ <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> |
|
620 |
+ <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> |
|
621 |
+ </layout> |
|
622 |
+ </component> |
|
623 |
+ <component name="Vcs.Log.UiProperties"> |
|
624 |
+ <option name="RECENTLY_FILTERED_USER_GROUPS"> |
|
625 |
+ <collection /> |
|
626 |
+ </option> |
|
627 |
+ </component> |
|
628 |
+ <component name="VcsContentAnnotationSettings"> |
|
629 |
+ <option name="myLimit" value="2678400000" /> |
|
630 |
+ </component> |
|
631 |
+ <component name="VcsManagerConfiguration"> |
|
632 |
+ <option name="myTodoPanelSettings"> |
|
633 |
+ <TodoPanelSettings /> |
|
634 |
+ </option> |
|
635 |
+ <MESSAGE value="Initial push. Trying to lay out the framework for development." /> |
|
636 |
+ <MESSAGE value="Laying out objects for game." /> |
|
637 |
+ <MESSAGE value="Saw some videos and converting more understanding to objects." /> |
|
638 |
+ <MESSAGE value="Moved from /x/y/z url to ?x=value&y=value2... adding gameplay on URL calls... was trying to provide a basic interface for it before this." /> |
|
639 |
+ <MESSAGE value="So the request goes through and response comes. Gameplay is left." /> |
|
640 |
+ <MESSAGE value="Fix face card value and add note to fix the case when there are multiple aces in hand." /> |
|
641 |
+ <MESSAGE value="Adding moves. Refined Hand->AddCard to handle aces better. Win condition and checking is left." /> |
|
642 |
+ <MESSAGE value="Bug fixes, split dealer from player, refined moves. Dealer needs to be dealt with and efficient win condition evaluation needs to be arrived at." /> |
|
643 |
+ <MESSAGE value="Working towards endgame. Left some TODO notes. Added shuffling of shoe after a certain configurable number of cards have been drawn." /> |
|
644 |
+ <MESSAGE value="Done with playable game. Haven't debugged it to my heart's content because of lack of UI. Will do that sometime and refine some more. Dealer's hand's win state boolean is inconsequential. Class design needs to be tweaked there. Game is completely server authoritative." /> |
|
645 |
+ <option name="LAST_COMMIT_MESSAGE" value="Done with playable game. Haven't debugged it to my heart's content because of lack of UI. Will do that sometime and refine some more. Dealer's hand's win state boolean is inconsequential. Class design needs to be tweaked there. Game is completely server authoritative." /> |
|
646 |
+ </component> |
|
647 |
+ <component name="XDebuggerManager"> |
|
648 |
+ <breakpoint-manager> |
|
649 |
+ <option name="time" value="20" /> |
|
650 |
+ </breakpoint-manager> |
|
651 |
+ </component> |
|
652 |
+ <component name="editorHistoryManager"> |
|
653 |
+ <entry file="file://$PROJECT_DIR$/Objects/Player.php"> |
|
654 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
655 |
+ <state line="89" column="0" selection-start="2188" selection-end="2188" vertical-scroll-proportion="0.0" vertical-offset="1513" max-vertical-offset="2023"> |
|
656 |
+ <folding /> |
|
657 |
+ </state> |
|
658 |
+ </provider> |
|
659 |
+ </entry> |
|
660 |
+ <entry file="file://$PROJECT_DIR$/Objects/Shoe.php"> |
|
661 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
662 |
+ <state line="42" column="32" selection-start="1192" selection-end="1192" vertical-scroll-proportion="0.0" vertical-offset="714" max-vertical-offset="952" /> |
|
663 |
+ </provider> |
|
664 |
+ </entry> |
|
665 |
+ <entry file="file://$PROJECT_DIR$/Objects/Response.php"> |
|
666 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
667 |
+ <state line="19" column="1" selection-start="283" selection-end="283" vertical-scroll-proportion="0.0" vertical-offset="323" max-vertical-offset="425"> |
|
668 |
+ <folding /> |
|
669 |
+ </state> |
|
670 |
+ </provider> |
|
671 |
+ </entry> |
|
672 |
+ <entry file="file://$PROJECT_DIR$/Objects/Request.php"> |
|
673 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
674 |
+ <state line="7" column="21" selection-start="83" selection-end="83" vertical-scroll-proportion="0.0" vertical-offset="119" max-vertical-offset="935" /> |
|
675 |
+ </provider> |
|
676 |
+ </entry> |
|
677 |
+ <entry file="file://$PROJECT_DIR$/Objects/Deck.php"> |
|
678 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
679 |
+ <state line="17" column="31" selection-start="394" selection-end="394" vertical-scroll-proportion="0.0" vertical-offset="289" max-vertical-offset="1666"> |
|
680 |
+ <folding /> |
|
681 |
+ </state> |
|
682 |
+ </provider> |
|
683 |
+ </entry> |
|
684 |
+ <entry file="file://$PROJECT_DIR$/index.php"> |
|
685 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
686 |
+ <state line="11" column="37" selection-start="357" selection-end="357" vertical-scroll-proportion="0.0" vertical-offset="187" max-vertical-offset="544"> |
|
687 |
+ <folding> |
|
688 |
+ <element signature="n#Debug#0;n#!!top" expanded="true" /> |
|
689 |
+ <element signature="n#ValidateSession#0;n#!!top" expanded="true" /> |
|
690 |
+ </folding> |
|
691 |
+ </state> |
|
692 |
+ </provider> |
|
693 |
+ </entry> |
|
694 |
+ <entry file="file://$PROJECT_DIR$/Blackjack.php"> |
|
695 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
696 |
+ <state line="65" column="27" selection-start="1477" selection-end="1477" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1258"> |
|
697 |
+ <folding /> |
|
698 |
+ </state> |
|
699 |
+ </provider> |
|
700 |
+ </entry> |
|
701 |
+ <entry file="file://$PROJECT_DIR$/Objects/Error.php"> |
|
702 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
703 |
+ <state line="59" column="20" selection-start="2548" selection-end="2548" vertical-scroll-proportion="0.0" vertical-offset="1003" max-vertical-offset="1598"> |
|
704 |
+ <folding /> |
|
705 |
+ </state> |
|
706 |
+ </provider> |
|
707 |
+ </entry> |
|
708 |
+ <entry file="file://$PROJECT_DIR$/Objects/Hand.php"> |
|
709 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
710 |
+ <state line="26" column="0" selection-start="624" selection-end="624" vertical-scroll-proportion="0.0" vertical-offset="442" max-vertical-offset="2482"> |
|
711 |
+ <folding /> |
|
712 |
+ </state> |
|
713 |
+ </provider> |
|
714 |
+ </entry> |
|
715 |
+ <entry file="file://$PROJECT_DIR$/Objects/Player.php"> |
|
716 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
717 |
+ <state line="89" column="0" selection-start="2188" selection-end="2188" vertical-scroll-proportion="0.0" vertical-offset="1513" max-vertical-offset="2023"> |
|
718 |
+ <folding /> |
|
719 |
+ </state> |
|
720 |
+ </provider> |
|
721 |
+ </entry> |
|
722 |
+ <entry file="file://$PROJECT_DIR$/Objects/Shoe.php"> |
|
723 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
724 |
+ <state line="42" column="32" selection-start="1192" selection-end="1192" vertical-scroll-proportion="0.0" vertical-offset="714" max-vertical-offset="952" /> |
|
725 |
+ </provider> |
|
726 |
+ </entry> |
|
727 |
+ <entry file="file://$PROJECT_DIR$/Objects/Response.php"> |
|
728 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
729 |
+ <state line="19" column="1" selection-start="283" selection-end="283" vertical-scroll-proportion="0.0" vertical-offset="323" max-vertical-offset="425"> |
|
730 |
+ <folding /> |
|
731 |
+ </state> |
|
732 |
+ </provider> |
|
733 |
+ </entry> |
|
734 |
+ <entry file="file://$PROJECT_DIR$/Objects/Request.php"> |
|
735 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
736 |
+ <state line="7" column="21" selection-start="83" selection-end="83" vertical-scroll-proportion="0.0" vertical-offset="119" max-vertical-offset="935" /> |
|
737 |
+ </provider> |
|
738 |
+ </entry> |
|
739 |
+ <entry file="file://$PROJECT_DIR$/Objects/Deck.php"> |
|
740 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
741 |
+ <state line="17" column="31" selection-start="394" selection-end="394" vertical-scroll-proportion="0.0" vertical-offset="289" max-vertical-offset="1666"> |
|
742 |
+ <folding /> |
|
743 |
+ </state> |
|
744 |
+ </provider> |
|
745 |
+ </entry> |
|
746 |
+ <entry file="file://$PROJECT_DIR$/index.php"> |
|
747 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
748 |
+ <state line="15" column="21" selection-start="548" selection-end="548" vertical-scroll-proportion="0.0" vertical-offset="255" max-vertical-offset="544"> |
|
749 |
+ <folding> |
|
750 |
+ <element signature="n#Debug#0;n#!!top" expanded="true" /> |
|
751 |
+ <element signature="n#ValidateSession#0;n#!!top" expanded="true" /> |
|
752 |
+ </folding> |
|
753 |
+ </state> |
|
754 |
+ </provider> |
|
755 |
+ </entry> |
|
756 |
+ <entry file="file://$PROJECT_DIR$/Blackjack.php"> |
|
757 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
758 |
+ <state line="65" column="27" selection-start="1477" selection-end="1477" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1258"> |
|
759 |
+ <folding /> |
|
760 |
+ </state> |
|
761 |
+ </provider> |
|
762 |
+ </entry> |
|
763 |
+ <entry file="file://$PROJECT_DIR$/Objects/Error.php"> |
|
764 |
+ <provider editor-type-id="com.intellij.persistence.database.editor.CsvTableFileEditorProvider"> |
|
765 |
+ <state /> |
|
766 |
+ </provider> |
|
767 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
768 |
+ <state line="59" column="20" selection-start="2548" selection-end="2548" vertical-scroll-proportion="0.0" vertical-offset="1003" max-vertical-offset="1598"> |
|
769 |
+ <folding /> |
|
770 |
+ </state> |
|
771 |
+ </provider> |
|
772 |
+ </entry> |
|
773 |
+ <entry file="file://$PROJECT_DIR$/Objects/Hand.php"> |
|
774 |
+ <provider editor-type-id="com.intellij.persistence.database.editor.CsvTableFileEditorProvider"> |
|
775 |
+ <state /> |
|
776 |
+ </provider> |
|
777 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
778 |
+ <state line="26" column="0" selection-start="624" selection-end="624" vertical-scroll-proportion="0.0" vertical-offset="442" max-vertical-offset="2482"> |
|
779 |
+ <folding /> |
|
780 |
+ </state> |
|
781 |
+ </provider> |
|
782 |
+ </entry> |
|
783 |
+ <entry file="file://$PROJECT_DIR$/Objects/Player.php"> |
|
784 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
785 |
+ <state line="89" column="0" selection-start="2188" selection-end="2188" vertical-scroll-proportion="0.0" vertical-offset="1513" max-vertical-offset="2023"> |
|
786 |
+ <folding /> |
|
787 |
+ </state> |
|
788 |
+ </provider> |
|
789 |
+ </entry> |
|
790 |
+ <entry file="file://$PROJECT_DIR$/Objects/Shoe.php"> |
|
791 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
792 |
+ <state line="42" column="32" selection-start="1192" selection-end="1192" vertical-scroll-proportion="0.0" vertical-offset="714" max-vertical-offset="952" /> |
|
793 |
+ </provider> |
|
794 |
+ </entry> |
|
795 |
+ <entry file="file://$PROJECT_DIR$/Objects/Response.php"> |
|
796 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
797 |
+ <state line="19" column="1" selection-start="283" selection-end="283" vertical-scroll-proportion="0.0" vertical-offset="323" max-vertical-offset="425"> |
|
798 |
+ <folding /> |
|
799 |
+ </state> |
|
800 |
+ </provider> |
|
801 |
+ </entry> |
|
802 |
+ <entry file="file://$PROJECT_DIR$/Objects/Request.php"> |
|
803 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
804 |
+ <state line="7" column="21" selection-start="83" selection-end="83" vertical-scroll-proportion="0.0" vertical-offset="119" max-vertical-offset="935" /> |
|
805 |
+ </provider> |
|
806 |
+ </entry> |
|
807 |
+ <entry file="file://$PROJECT_DIR$/Objects/Deck.php"> |
|
808 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
809 |
+ <state line="17" column="31" selection-start="394" selection-end="394" vertical-scroll-proportion="0.0" vertical-offset="289" max-vertical-offset="1666"> |
|
810 |
+ <folding /> |
|
811 |
+ </state> |
|
812 |
+ </provider> |
|
813 |
+ </entry> |
|
814 |
+ <entry file="file://$PROJECT_DIR$/index.php"> |
|
815 |
+ <provider editor-type-id="com.intellij.persistence.database.editor.CsvTableFileEditorProvider"> |
|
816 |
+ <state /> |
|
817 |
+ </provider> |
|
818 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
819 |
+ <state line="83" column="60" selection-start="2971" selection-end="2971" vertical-scroll-proportion="0.0" vertical-offset="546" max-vertical-offset="1904"> |
|
820 |
+ <folding> |
|
821 |
+ <element signature="n#Debug#0;n#!!top" expanded="true" /> |
|
822 |
+ <element signature="n#ValidateSession#0;n#!!top" expanded="true" /> |
|
823 |
+ </folding> |
|
824 |
+ </state> |
|
825 |
+ </provider> |
|
826 |
+ </entry> |
|
827 |
+ <entry file="file://$PROJECT_DIR$/Blackjack.php"> |
|
828 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
829 |
+ <state line="65" column="27" selection-start="1477" selection-end="1477" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1258"> |
|
830 |
+ <folding /> |
|
831 |
+ </state> |
|
832 |
+ </provider> |
|
833 |
+ </entry> |
|
834 |
+ <entry file="file://$PROJECT_DIR$/Objects/Error.php"> |
|
835 |
+ <provider editor-type-id="com.intellij.persistence.database.editor.CsvTableFileEditorProvider"> |
|
836 |
+ <state /> |
|
837 |
+ </provider> |
|
838 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
839 |
+ <state line="59" column="20" selection-start="2548" selection-end="2548" vertical-scroll-proportion="0.0" vertical-offset="1003" max-vertical-offset="1598"> |
|
840 |
+ <folding /> |
|
841 |
+ </state> |
|
842 |
+ </provider> |
|
843 |
+ </entry> |
|
844 |
+ <entry file="file://$PROJECT_DIR$/Objects/Hand.php"> |
|
845 |
+ <provider editor-type-id="com.intellij.persistence.database.editor.CsvTableFileEditorProvider"> |
|
846 |
+ <state /> |
|
847 |
+ </provider> |
|
848 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
849 |
+ <state line="26" column="0" selection-start="624" selection-end="624" vertical-scroll-proportion="0.0" vertical-offset="442" max-vertical-offset="2482"> |
|
850 |
+ <folding /> |
|
851 |
+ </state> |
|
852 |
+ </provider> |
|
853 |
+ </entry> |
|
854 |
+ <entry file="file://$PROJECT_DIR$/Objects/Player.php"> |
|
855 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
856 |
+ <state line="89" column="0" selection-start="2188" selection-end="2188" vertical-scroll-proportion="0.0" vertical-offset="1513" max-vertical-offset="2023"> |
|
857 |
+ <folding /> |
|
858 |
+ </state> |
|
859 |
+ </provider> |
|
860 |
+ </entry> |
|
861 |
+ <entry file="file://$PROJECT_DIR$/Objects/Shoe.php"> |
|
862 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
863 |
+ <state line="42" column="32" selection-start="1192" selection-end="1192" vertical-scroll-proportion="0.0" vertical-offset="714" max-vertical-offset="952" /> |
|
864 |
+ </provider> |
|
865 |
+ </entry> |
|
866 |
+ <entry file="file://$PROJECT_DIR$/Objects/Response.php"> |
|
867 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
868 |
+ <state line="19" column="1" selection-start="283" selection-end="283" vertical-scroll-proportion="0.0" vertical-offset="323" max-vertical-offset="425"> |
|
869 |
+ <folding /> |
|
870 |
+ </state> |
|
871 |
+ </provider> |
|
872 |
+ </entry> |
|
873 |
+ <entry file="file://$PROJECT_DIR$/Objects/Request.php"> |
|
874 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
875 |
+ <state line="7" column="21" selection-start="83" selection-end="83" vertical-scroll-proportion="0.0" vertical-offset="119" max-vertical-offset="935" /> |
|
876 |
+ </provider> |
|
877 |
+ </entry> |
|
878 |
+ <entry file="file://$PROJECT_DIR$/Objects/Deck.php"> |
|
879 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
880 |
+ <state line="17" column="31" selection-start="394" selection-end="394" vertical-scroll-proportion="0.0" vertical-offset="289" max-vertical-offset="1666"> |
|
881 |
+ <folding /> |
|
882 |
+ </state> |
|
883 |
+ </provider> |
|
884 |
+ </entry> |
|
885 |
+ <entry file="file://$PROJECT_DIR$/index.php"> |
|
886 |
+ <provider editor-type-id="com.intellij.persistence.database.editor.CsvTableFileEditorProvider"> |
|
887 |
+ <state /> |
|
888 |
+ </provider> |
|
889 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
890 |
+ <state line="83" column="60" selection-start="2971" selection-end="2971" vertical-scroll-proportion="0.0" vertical-offset="1411" max-vertical-offset="1904"> |
|
891 |
+ <folding> |
|
892 |
+ <element signature="n#Debug#0;n#!!top" expanded="true" /> |
|
893 |
+ <element signature="n#ValidateSession#0;n#!!top" expanded="true" /> |
|
894 |
+ </folding> |
|
895 |
+ </state> |
|
896 |
+ </provider> |
|
897 |
+ </entry> |
|
898 |
+ <entry file="file://$PROJECT_DIR$/UI/style/bjstyles.css"> |
|
899 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
900 |
+ <state line="10" column="16" selection-start="96" selection-end="96" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="0" /> |
|
901 |
+ </provider> |
|
902 |
+ </entry> |
|
903 |
+ <entry file="file://$PROJECT_DIR$/UI/table.php"> |
|
904 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
905 |
+ <state line="17" column="0" selection-start="366" selection-end="366" vertical-scroll-proportion="-11.115385" vertical-offset="0" max-vertical-offset="0" /> |
|
906 |
+ </provider> |
|
907 |
+ </entry> |
|
908 |
+ <entry file="file://$PROJECT_DIR$/UI/name.php"> |
|
909 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
910 |
+ <state line="1" column="23" selection-start="29" selection-end="29" vertical-scroll-proportion="-0.65384614" vertical-offset="0" max-vertical-offset="0" /> |
|
911 |
+ </provider> |
|
912 |
+ </entry> |
|
913 |
+ <entry file="file:///mnt/docs/src/interviews/Blackjack/index.php"> |
|
914 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
915 |
+ <state line="37" column="113" selection-start="1192" selection-end="1192" vertical-scroll-proportion="-24.192308" vertical-offset="0" max-vertical-offset="0" /> |
|
916 |
+ </provider> |
|
917 |
+ </entry> |
|
918 |
+ <entry file="jar://$USER_HOME$/.IntelliJIdea12/config/plugins/php/lib/php.jar!/com/jetbrains/php/lang/psi/stubs/data/standard_8.php"> |
|
919 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
920 |
+ <state line="962" column="9" selection-start="30821" selection-end="30821" vertical-scroll-proportion="0.3431604" vertical-offset="0" max-vertical-offset="0" /> |
|
921 |
+ </provider> |
|
922 |
+ </entry> |
|
923 |
+ <entry file="file://$PROJECT_DIR$/Objects/Card.php"> |
|
924 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
925 |
+ <state line="16" column="20" selection-start="193" selection-end="193" vertical-scroll-proportion="0.24" vertical-offset="0" max-vertical-offset="0" /> |
|
926 |
+ </provider> |
|
927 |
+ </entry> |
|
928 |
+ <entry file="file://$PROJECT_DIR$/Objects/Request.php"> |
|
929 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
930 |
+ <state line="7" column="21" selection-start="83" selection-end="83" vertical-scroll-proportion="0.05821918" vertical-offset="0" max-vertical-offset="876" /> |
|
931 |
+ </provider> |
|
932 |
+ </entry> |
|
933 |
+ <entry file="file://$PROJECT_DIR$/Objects/Shoe.php"> |
|
934 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
935 |
+ <state line="53" column="0" selection-start="1547" selection-end="1547" vertical-scroll-proportion="-6.5384617" vertical-offset="663" max-vertical-offset="1258"> |
|
936 |
+ <folding /> |
|
937 |
+ </state> |
|
938 |
+ </provider> |
|
939 |
+ </entry> |
|
940 |
+ <entry file="file://$PROJECT_DIR$/index.php"> |
|
941 |
+ <provider editor-type-id="com.intellij.persistence.database.editor.CsvTableFileEditorProvider"> |
|
942 |
+ <state /> |
|
943 |
+ </provider> |
|
944 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
945 |
+ <state line="105" column="82" selection-start="3829" selection-end="3829" vertical-scroll-proportion="-68.65385" vertical-offset="0" max-vertical-offset="2533"> |
|
946 |
+ <folding> |
|
947 |
+ <element signature="n#Debug#0;n#!!top" expanded="true" /> |
|
948 |
+ <element signature="n#ValidateSession#0;n#!!top" expanded="true" /> |
|
949 |
+ </folding> |
|
950 |
+ </state> |
|
951 |
+ </provider> |
|
952 |
+ </entry> |
|
953 |
+ <entry file="file://$PROJECT_DIR$/Objects/Deck.php"> |
|
954 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
955 |
+ <state line="52" column="17" selection-start="1481" selection-end="1481" vertical-scroll-proportion="-31.384615" vertical-offset="0" max-vertical-offset="1598"> |
|
956 |
+ <folding /> |
|
957 |
+ </state> |
|
958 |
+ </provider> |
|
959 |
+ </entry> |
|
960 |
+ <entry file="file://$PROJECT_DIR$/Objects/Response.php"> |
|
961 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
962 |
+ <state line="19" column="46" selection-start="365" selection-end="365" vertical-scroll-proportion="-9.807693" vertical-offset="0" max-vertical-offset="391"> |
|
963 |
+ <folding /> |
|
964 |
+ </state> |
|
965 |
+ </provider> |
|
966 |
+ </entry> |
|
967 |
+ <entry file="file://$PROJECT_DIR$/Config/Config.php"> |
|
968 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
969 |
+ <state line="18" column="84" selection-start="575" selection-end="575" vertical-scroll-proportion="-9.153846" vertical-offset="0" max-vertical-offset="680"> |
|
970 |
+ <folding /> |
|
971 |
+ </state> |
|
972 |
+ </provider> |
|
973 |
+ </entry> |
|
974 |
+ <entry file="file://$PROJECT_DIR$/Objects/Dealer.php"> |
|
975 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
976 |
+ <state line="45" column="15" selection-start="981" selection-end="981" vertical-scroll-proportion="-26.807692" vertical-offset="0" max-vertical-offset="833"> |
|
977 |
+ <folding /> |
|
978 |
+ </state> |
|
979 |
+ </provider> |
|
980 |
+ </entry> |
|
981 |
+ <entry file="file://$PROJECT_DIR$/Objects/PlayerBase.php"> |
|
982 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
983 |
+ <state line="54" column="0" selection-start="1142" selection-end="1142" vertical-scroll-proportion="-28.73077" vertical-offset="103" max-vertical-offset="986"> |
|
984 |
+ <folding /> |
|
985 |
+ </state> |
|
986 |
+ </provider> |
|
987 |
+ </entry> |
|
988 |
+ <entry file="file://$PROJECT_DIR$/Objects/Hand.php"> |
|
989 |
+ <provider editor-type-id="com.intellij.persistence.database.editor.CsvTableFileEditorProvider"> |
|
990 |
+ <state /> |
|
991 |
+ </provider> |
|
992 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
993 |
+ <state line="138" column="29" selection-start="3884" selection-end="3884" vertical-scroll-proportion="-87.61539" vertical-offset="0" max-vertical-offset="3043"> |
|
994 |
+ <folding /> |
|
995 |
+ </state> |
|
996 |
+ </provider> |
|
997 |
+ </entry> |
|
998 |
+ <entry file="file://$PROJECT_DIR$/Objects/Player.php"> |
|
999 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
1000 |
+ <state line="11" column="0" selection-start="122" selection-end="122" vertical-scroll-proportion="-4.576923" vertical-offset="0" max-vertical-offset="1751"> |
|
1001 |
+ <folding /> |
|
1002 |
+ </state> |
|
1003 |
+ </provider> |
|
1004 |
+ </entry> |
|
1005 |
+ <entry file="file://$PROJECT_DIR$/Objects/Error.php"> |
|
1006 |
+ <provider editor-type-id="com.intellij.persistence.database.editor.CsvTableFileEditorProvider"> |
|
1007 |
+ <state /> |
|
1008 |
+ </provider> |
|
1009 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
1010 |
+ <state line="54" column="82" selection-start="2312" selection-end="2312" vertical-scroll-proportion="-31.346153" vertical-offset="35" max-vertical-offset="1785"> |
|
1011 |
+ <folding /> |
|
1012 |
+ </state> |
|
1013 |
+ </provider> |
|
1014 |
+ </entry> |
|
1015 |
+ <entry file="file://$PROJECT_DIR$/Blackjack.php"> |
|
1016 |
+ <provider selected="true" editor-type-id="text-editor"> |
|
1017 |
+ <state line="118" column="52" selection-start="3259" selection-end="3259" vertical-scroll-proportion="0.46092865" vertical-offset="1446" max-vertical-offset="2329"> |
|
1018 |
+ <folding /> |
|
1019 |
+ </state> |
|
1020 |
+ </provider> |
|
1021 |
+ </entry> |
|
1022 |
+ </component> |
|
1023 |
+</project> |
|
1024 |
+ |
... | ... |
@@ -0,0 +1,9 @@ |
1 |
+<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
+<module type="WEB_MODULE" version="4"> |
|
3 |
+ <component name="NewModuleRootManager" inherit-compiler-output="true"> |
|
4 |
+ <exclude-output /> |
|
5 |
+ <content url="file://$MODULE_DIR$" /> |
|
6 |
+ <orderEntry type="sourceFolder" forTests="false" /> |
|
7 |
+ </component> |
|
8 |
+</module> |
|
9 |
+ |
... | ... |
@@ -0,0 +1,141 @@ |
1 |
+<?php |
|
2 |
+/** |
|
3 |
+ * User: dev |
|
4 |
+ * Date: 3/11/14 |
|
5 |
+ * Time: 12:25 AM |
|
6 |
+ */ |
|
7 |
+ |
|
8 |
+namespace Blackjack; |
|
9 |
+ |
|
10 |
+require_once 'Config/Config.php'; |
|
11 |
+require_once 'Objects/Shoe.php'; |
|
12 |
+require_once 'Objects/Hand.php'; |
|
13 |
+require_once 'Objects/Player.php'; |
|
14 |
+require_once 'Objects/Dealer.php'; |
|
15 |
+ |
|
16 |
+ |
|
17 |
+use Blackjack\Config\Config; |
|
18 |
+use Blackjack\Objects\Error; |
|
19 |
+use Blackjack\Objects\Hand; |
|
20 |
+use Blackjack\Objects\Player; |
|
21 |
+use Blackjack\Objects\Dealer; |
|
22 |
+use Blackjack\Objects\Shoe; |
|
23 |
+ |
|
24 |
+define('BJ_TABLE_IN_PROGRESS', 2048); |
|
25 |
+define('BJ_TABLE_TURN_PLAYER', 2049); |
|
26 |
+define('BJ_TABLE_TURN_DEALER', 2050); |
|
27 |
+define('BJ_TABLE_ENDED', 2100); |
|
28 |
+ |
|
29 |
+class Blackjack |
|
30 |
+{ |
|
31 |
+ /*** |
|
32 |
+ * @var Shoe Collection of multiple decks from which cards are dealt. |
|
33 |
+ */ |
|
34 |
+ private $shoe; |
|
35 |
+ |
|
36 |
+ /*** |
|
37 |
+ * @var Objects\Player Dealer of the table. |
|
38 |
+ */ |
|
39 |
+ public $dealer; |
|
40 |
+ |
|
41 |
+ /*** |
|
42 |
+ * @var Objects\Player Player for the table. Public to allow json_encode to serialize it. |
|
43 |
+ */ |
|
44 |
+ public $player; |
|
45 |
+ |
|
46 |
+ /*** |
|
47 |
+ * @var Config Configuration for this game. |
|
48 |
+ */ |
|
49 |
+ private $config; |
|
50 |
+ |
|
51 |
+ private $tableState; |
|
52 |
+ |
|
53 |
+ public function __construct(Config $config, $playerName) |
|
54 |
+ { |
|
55 |
+ $this->config = $config; |
|
56 |
+ $this->shoe = new Shoe($config); |
|
57 |
+ $this->tableState = BJ_TABLE_TURN_PLAYER; |
|
58 |
+ |
|
59 |
+ $playerHand = new Hand(); |
|
60 |
+ $dealerHand = new Hand(); |
|
61 |
+ |
|
62 |
+ $playerHand->AddCard($this->shoe->PickCard()); |
|
63 |
+ $playerHand->AddCard($this->shoe->PickCard()); |
|
64 |
+ |
|
65 |
+ $dealerHand->AddCard($this->shoe->PickCard()); |
|
66 |
+ |
|
67 |
+ $this->player = new Player($config, $playerHand, $playerName); |
|
68 |
+ $this->dealer = new Dealer($config, $dealerHand, $this->shoe->PickCard()); |
|
69 |
+ } |
|
70 |
+ |
|
71 |
+ public function GetShoe() |
|
72 |
+ { |
|
73 |
+ return $this->shoe; |
|
74 |
+ } |
|
75 |
+ |
|
76 |
+ public function UpdateTableState($playerHandIndex) |
|
77 |
+ { |
|
78 |
+ if($this->player->GetHand($playerHandIndex)->IsBusted()) |
|
79 |
+ { |
|
80 |
+ //Player bust, dealer wins. return Dealer Object. |
|
81 |
+ $this->player->GetHand($playerHandIndex)->SetState(BJ_HAND_LOST); |
|
82 |
+ $this->dealer->SetState(BJ_HAND_WON); |
|
83 |
+ } |
|
84 |
+ elseif($this->tableState == BJ_TABLE_TURN_DEALER) |
|
85 |
+ { |
|
86 |
+ $playerHand = $this->player->GetHand($playerHandIndex); |
|
87 |
+ $playerSum = $playerHand->GetSum(); |
|
88 |
+ |
|
89 |
+ $dealerSum = $this->dealer->GetSum(); |
|
90 |
+ |
|
91 |
+ while($dealerSum < 17) |
|
92 |
+ { |
|
93 |
+ $isHitSuccessful = $this->dealer->Hit($this->shoe->PickCard()); |
|
94 |
+ if($isHitSuccessful instanceof Error) |
|
95 |
+ return $isHitSuccessful; |
|
96 |
+ |
|
97 |
+ $dealerSum = $this->dealer->GetSum(); |
|
98 |
+ } |
|
99 |
+ |
|
100 |
+ |
|
101 |
+ if($dealerSum > 21) |
|
102 |
+ { |
|
103 |
+ //dealer bust, player wins |
|
104 |
+ $playerHand->SetState(BJ_HAND_WON); |
|
105 |
+ $this->dealer->SetState(BJ_HAND_LOST); |
|
106 |
+ } |
|
107 |
+ elseif($playerSum < $dealerSum) |
|
108 |
+ { |
|
109 |
+ $playerHand->SetState(BJ_HAND_LOST); |
|
110 |
+ $this->dealer->SetState(BJ_HAND_WON); |
|
111 |
+ } |
|
112 |
+ elseif($playerSum > $dealerSum) |
|
113 |
+ { |
|
114 |
+ $playerHand->SetState(BJ_HAND_WON); |
|
115 |
+ $this->dealer->SetState(BJ_HAND_LOST); |
|
116 |
+ } |
|
117 |
+ elseif($playerSum == $dealerSum) |
|
118 |
+ { |
|
119 |
+ $playerHand->SetState(BJ_HAND_DRAW); |
|
120 |
+ $this->dealer->SetState(BJ_HAND_DRAW); |
|
121 |
+ } |
|
122 |
+ } |
|
123 |
+ } |
|
124 |
+ |
|
125 |
+ public function GetTableState() |
|
126 |
+ { |
|
127 |
+ //Make sure none of the hands of the player is in Stand state. If it is, game has not ended. |
|
128 |
+ foreach($this->player->hands as $hand) |
|
129 |
+ { |
|
130 |
+ if($hand->GetState() == BJ_HAND_IN_PROGRESS || $hand->GetState() == BJ_HAND_STAND) |
|
131 |
+ return BJ_TABLE_IN_PROGRESS; |
|
132 |
+ } |
|
133 |
+ |
|
134 |
+ return BJ_TABLE_ENDED; |
|
135 |
+ } |
|
136 |
+ |
|
137 |
+ public function SetDealerTurn() |
|
138 |
+ { |
|
139 |
+ $this->tableState = BJ_TABLE_TURN_DEALER; |
|
140 |
+ } |
|
141 |
+} |
|
0 | 142 |
\ No newline at end of file |
... | ... |
@@ -0,0 +1,39 @@ |
1 |
+<?php |
|
2 |
+/** |
|
3 |
+ * User: dev |
|
4 |
+ * Date: 3/11/14 |
|
5 |
+ * Time: 9:00 AM |
|
6 |
+ */ |
|
7 |
+ |
|
8 |
+namespace Blackjack\Config; |
|
9 |
+ |
|
10 |
+ |
|
11 |
+class Config { |
|
12 |
+ private $_config = array( |
|
13 |
+ 'salt' => 'bc29065419d68b9c726839af3e8ed6e9c40024f32c1808447e1906de84e3c2b9', #echo 'latrax powered by traxxas' | sha256sum -- |
|
14 |
+ 'cryptAlgorithm' => 'RSA512', |
|
15 |
+ 'logError' => false, |
|
16 |
+ 'maxNumDecks' => 8, |
|
17 |
+ 'maxHandsPerPlayer' => 2, |
|
18 |
+ 'maxNameLength' => 15, |
|
19 |
+ 'cardShuffleFraction' => 0.1, //Shuffle shoe when 10% of cards are picked. |
|
20 |
+ ); |
|
21 |
+ |
|
22 |
+ public function __get($configKey) |
|
23 |
+ { |
|
24 |
+ if (!array_key_exists($configKey, $this->_config)) |
|
25 |
+ return null; |
|
26 |
+ |
|
27 |
+ return $this->_config[$configKey]; |
|
28 |
+ } |
|
29 |
+ |
|
30 |
+ public function __set($key, $value) |
|
31 |
+ { |
|
32 |
+ throw new \ErrorException("Configuration values cannot be set at runtime."); |
|
33 |
+ } |
|
34 |
+ |
|
35 |
+ public function __isset($key) |
|
36 |
+ { |
|
37 |
+ return isset($this->_config[$key]); |
|
38 |
+ } |
|
39 |
+} |
|
0 | 40 |
\ No newline at end of file |
... | ... |
@@ -0,0 +1,27 @@ |
1 |
+<?php |
|
2 |
+/** |
|
3 |
+ * User: dev |
|
4 |
+ * Date: 3/13/14 |
|
5 |
+ * Time: 9:23 AM |
|
6 |
+ */ |
|
7 |
+ |
|
8 |
+namespace Blackjack\Objects; |
|
9 |
+ |
|
10 |
+ |
|
11 |
+class Card |
|
12 |
+{ |
|
13 |
+ public $valueFace; |
|
14 |
+ public $suit; |
|
15 |
+ public $valueActual; |
|
16 |
+ |
|
17 |
+ public function __construct($suit = null, $faceValue = null, $actualValue = null) |
|
18 |
+ { |
|
19 |
+ if($suit == null || $faceValue == null || $actualValue == null) |
|
20 |
+ { |
|
21 |
+ throw new \Exception("Cannot initialize Card with null for suit or value", E_BJ_WRONG_CARD_INIT); |
|
22 |
+ } |
|
23 |
+ $this->suit = $suit; |
|
24 |
+ $this->valueFace = $faceValue; |
|
25 |
+ $this->valueActual = $actualValue; |
|
26 |
+ } |
|
27 |
+} |
|
0 | 28 |
\ No newline at end of file |
... | ... |
@@ -0,0 +1,48 @@ |
1 |
+<?php |
|
2 |
+/** |
|
3 |
+ * User: dev |
|
4 |
+ * Date: 3/16/14 |
|
5 |
+ * Time: 10:52 PM |
|
6 |
+ */ |
|
7 |
+ |
|
8 |
+namespace Blackjack\Objects; |
|
9 |
+ |
|
10 |
+use Blackjack\Config\Config; |
|
11 |
+ |
|
12 |
+require_once 'PlayerBase.php'; |
|
13 |
+ |
|
14 |
+class Dealer extends PlayerBase |
|
15 |
+{ |
|
16 |
+ private $firstCard = null; |
|
17 |
+ |
|
18 |
+ public function __construct(Config $config, Hand $hand, Card $firstCard) |
|
19 |
+ { |
|
20 |
+ //remove the first card from the hand and store it in the class |
|
21 |
+ //variable. |
|
22 |
+ $this->firstCard = $firstCard; |
|
23 |
+ parent::__construct($config, $hand, 'Dealer'); |
|
24 |
+ } |
|
25 |
+ |
|
26 |
+ public function Hit(Card $card) |
|
27 |
+ { |
|
28 |
+ //add the card stored in $firstCard if we are taking a hit. |
|
29 |
+ if($this->firstCard != null) |
|
30 |
+ { |
|
31 |
+ $retVal = parent::Hit(0, $this->firstCard); |
|
32 |
+ $this->firstCard = null; |
|
33 |
+ return $retVal; |
|
34 |
+ } |
|
35 |
+ |
|
36 |
+ return parent::Hit(0, $card); |
|
37 |
+ } |
|
38 |
+ |
|
39 |
+ public function GetSum() |
|
40 |
+ { |
|
41 |
+ return $this->hands[0]->GetSum(); |
|
42 |
+ } |
|
43 |
+ |
|
44 |
+ public function SetState($stateConstant) |
|
45 |
+ { |
|
46 |
+ return parent::$hands[0]->SetState($stateConstant); |
|
47 |
+ } |
|
48 |
+} |
|
0 | 49 |
\ No newline at end of file |
... | ... |
@@ -0,0 +1,93 @@ |
1 |
+<?php |
|
2 |
+/** |
|
3 |
+ * User: dev |
|
4 |
+ * Date: 3/13/14 |
|
5 |
+ * Time: 9:24 AM |
|
6 |
+ */ |
|
7 |
+ |
|
8 |
+namespace Blackjack\Objects; |
|
9 |
+ |
|
10 |
+require_once 'Card.php'; |
|
11 |
+/* |
|
12 |
+ * Using PHP_INT_MAX values so that they do not intersect with other integer constants anywhere. |
|
13 |
+ * Suits don't matter in Blackjack. |
|
14 |
+ */ |
|
15 |
+define('HEARTS', 'Hearts'); |
|
16 |
+define('DIAMONDS', 'Diamonds'); |
|
17 |
+define('CLUBS', 'Clubs'); |
|
18 |
+define('SPADES', 'Spades'); |
|
19 |
+ |
|
20 |
+class Deck |
|
21 |
+{ |
|
22 |
+ public $cards = array(); |
|
23 |
+ |
|
24 |
+ private function GenerateDeck() |
|
25 |
+ { |
|
26 |
+ $suits = array(HEARTS, DIAMONDS, CLUBS, SPADES); |
|
27 |
+ //no cards were passed, make the deck yourself |
|
28 |
+ |
|
29 |
+ $suitsLeft = count($suits); |
|
30 |
+ while($suitsLeft > 0) |
|
31 |
+ { |
|
32 |
+ //default suit is the first one in the array |
|
33 |
+ $suit= $suits[0]; |
|
34 |
+ |
|
35 |
+ if($suitsLeft > 1) |
|
36 |
+ { |
|
37 |
+ //pick a suit at random |
|
38 |
+ $suitIndex = mt_rand(0, $suitsLeft - 1); |
|
39 |
+ $suit = $suits[$suitIndex]; |
|
40 |
+ |
|
41 |
+ //Unsetting values will not reassign the indexes... causing problems. |
|
42 |
+ //Hence copying over the last value to the value that needs to be deleted |
|
43 |
+ //and popping the last value. End result would be same for last value. |
|
44 |
+ $suits[$suitIndex] = $suits[$suitsLeft - 1]; |
|
45 |
+ } |
|
46 |
+ array_pop($suits); |
|
47 |
+ $suitsLeft = count($suits); |
|
48 |
+ |
|
49 |
+ for($i=1; $i<14; $i++) |
|
50 |
+ { |
|
51 |
+ $card = null; |
|
52 |
+ switch($i) |
|
53 |
+ { |
|
54 |
+ case 1: |
|
55 |
+ $card = new Card($suit, 'A', $i); |
|
56 |
+ break; |
|
57 |
+ case 11: |
|
58 |
+ $card = new Card($suit, 'J', 10); |
|
59 |
+ break; |
|
60 |
+ case 12: |
|
61 |
+ $card = new Card($suit, 'Q', 10); |
|
62 |
+ break; |
|
63 |
+ case 13: |
|
64 |
+ $card = new Card($suit, 'K', 10); |
|
65 |
+ break; |
|
66 |
+ default: |
|
67 |
+ $card = new Card($suit, $i, $i); |
|
68 |
+ } |
|
69 |
+ array_push($this->cards, $card); |
|
70 |
+ } // end of inner for loop |
|
71 |
+ } // end of while loop for suits |
|
72 |
+ } |
|
73 |
+ |
|
74 |
+ public function Shuffle() |
|
75 |
+ { |
|
76 |
+ // http://blog.codinghorror.com/the-danger-of-naivete/ |
|
77 |
+ for ($i = count($this->cards) - 1; $i > 0; $i--) |
|
78 |
+ { |
|
79 |
+ $nextRandomPosition = mt_rand(0, $i); |
|
80 |
+ $cardSwapSpace = $this->cards[$i]; |
|
81 |
+ $this->cards[$i] = $this->cards[$nextRandomPosition]; |
|
82 |
+ $this->cards[$nextRandomPosition] = $cardSwapSpace; |
|
83 |
+ } |
|
84 |
+ } |
|
85 |
+ |
|
86 |
+ public function __construct(array $cards=null) |
|
87 |
+ { |
|
88 |
+ if($cards == null) |
|
89 |
+ { |
|
90 |
+ $this->GenerateDeck(); |
|
91 |
+ } |
|
92 |
+ } |
|
93 |
+} |
|
0 | 94 |
\ No newline at end of file |
... | ... |
@@ -0,0 +1,104 @@ |
1 |
+<?php |
|
2 |
+/** |
|
3 |
+ * User: dev |
|
4 |
+ * Date: 3/11/14 |
|
5 |
+ * Time: 9:14 AM |
|
6 |
+ */ |
|
7 |
+ |
|
8 |
+namespace Blackjack\Objects; |
|
9 |
+ |
|
10 |
+require_once 'Config/Config.php'; |
|
11 |
+use Blackjack\config\Config as Config; |
|
12 |
+ |
|
13 |
+define('E_BJ_HAND_UNPLAYABLE', -19); |
|
14 |
+define('E_BJ_UNKNOWN_HAND_STATE', -18); |
|
15 |
+define('E_BJ_UNKNOWN_ENDGAME_STATE', -17); |
|
16 |
+define('E_BJ_HAND_INVALID_SUM', -16); |
|
17 |
+define('E_BJ_HAND_BAD_INDEX', -15); |
|
18 |
+define('E_BJ_MOVE_UNKNOWN', -14); |
|
19 |
+define('E_BJ_MOVE_NO_HAND_ID', -13); |
|
20 |
+define('E_BJ_NO_ACTIVE_SESSION', -12); |
|
21 |
+define('E_BJ_NO_NAME', -11); |
|
22 |
+define('E_BJ_CANNOT_SPLIT', -10); |
|
23 |
+define('E_BJ_HAND_LOCKED', -9); |
|
24 |
+define('E_BJ_WRONG_CARD_INIT', -8); |
|
25 |
+define('E_BJ_INSERT_FAILED', -7); |
|
26 |
+define('E_BJ_EXECUTE_QUERY_FAILED', -6); |
|
27 |
+define('E_BJ_PREPARE_QUERY_FAILED', -5); |
|
28 |
+define('E_BJ_LOAD_RECV_PRI_KEY_FAILED', -4); |
|
29 |
+define('E_BJ_LOAD_SEND_PUB_KEY_FAILED', -3); |
|
30 |
+define('E_BJ_INVALID_FUNCTION_CALL', -2); |
|
31 |
+define('E_BJ_DB_CONNECT_FAILED', -1); |
|
32 |
+define('E_BJ_LOGIN_FAILED', 1); |
|
33 |
+define('BJ_ERROR_CLASS_NAME', 'Error'); |
|
34 |
+ |
|
35 |
+$allErrorDescriptions = array( |
|
36 |
+ E_BJ_INSERT_FAILED => |
|
37 |
+ 'There was error inserting data into the database.', |
|
38 |
+ E_BJ_EXECUTE_QUERY_FAILED => |
|
39 |
+ 'There was an error executing the query.', |
|
40 |
+ E_BJ_PREPARE_QUERY_FAILED => |
|
41 |
+ 'Mysqli had problems with preparing the statement to send to DB.', |
|
42 |
+ E_BJ_LOAD_RECV_PRI_KEY_FAILED => |
|
43 |
+ 'There was an error loading private key to decrypt data.', |
|
44 |
+ E_BJ_LOAD_SEND_PUB_KEY_FAILED => |
|
45 |
+ 'Loading public key to encrypt data before responding... failed. Anyway, what\'s up?', |
|
46 |
+ E_BJ_INVALID_FUNCTION_CALL => |
|
47 |
+ 'An invalid function call was made. Expected number of parameters were not delivered.', |
|
48 |
+ E_BJ_DB_CONNECT_FAILED => |
|
49 |
+ 'Could not connect to the database with the given credentials.', |
|
50 |
+ E_BJ_LOGIN_FAILED => |
|
51 |
+ 'ACCESS_DENIED', |
|
52 |
+ E_BJ_WRONG_CARD_INIT => |
|
53 |
+ 'A Card cannot be initialized with null for $suit or $value', |
|
54 |
+ E_BJ_HAND_LOCKED => |
|
55 |
+ 'The hand is locked probably because you doubled down or stood on a split hand. Cannot add more cards.', |
|
56 |
+ E_BJ_CANNOT_SPLIT => |
|
57 |
+ 'Cannot split hand.', |
|
58 |
+ E_BJ_NO_NAME => |
|
59 |
+ 'Player name not provided.', |
|
60 |
+ E_BJ_NO_ACTIVE_SESSION => |
|
61 |
+ 'An active session was not found. Please try restarting the game by resending just the name.', |
|
62 |
+ E_BJ_MOVE_NO_HAND_ID => |
|
63 |
+ 'Looks like the player wants to move but has not supplied id of the hand in which to make the move.', |
|
64 |
+ E_BJ_MOVE_UNKNOWN => |
|
65 |
+ 'Unknown move.', |
|
66 |
+ E_BJ_HAND_BAD_INDEX => |
|
67 |
+ 'An attempt was made to address an invalid hand.', |
|
68 |
+ E_BJ_HAND_INVALID_SUM => |
|
69 |
+ 'Sum of cards in hand is less than 17. Please Hit more.', |
|
70 |
+ E_BJ_UNKNOWN_ENDGAME_STATE => |
|
71 |
+ 'Unhandled end game state was encountered. Please file a bug with the developer with a description of all hands on the table.', |
|
72 |
+ E_BJ_UNKNOWN_HAND_STATE => |
|
73 |
+ 'An attempt was made to set hand to an unknown state. Please contact the developer. This is probably a programming error.', |
|
74 |
+ E_BJ_HAND_UNPLAYABLE => |
|
75 |
+ 'The hand is no longer playable as the match has ended with that hand.', |
|
76 |
+); |
|
77 |
+ |
|
78 |
+class Error { |
|
79 |
+ public $errorCode; |
|
80 |
+ public $errorDescription; |
|
81 |
+ |
|
82 |
+ private $_config; |
|
83 |
+ |
|
84 |
+ function __construct($errorCode, $errorDescription = '') |
|
85 |
+ { |
|
86 |
+ global $allErrorDescriptions; |
|
87 |
+ $this->errorCode = $errorCode; |
|
88 |
+ if($errorDescription != '') |
|
89 |
+ $this->errorDescription = $errorDescription; |
|
90 |
+ else if(array_key_exists($errorCode, $allErrorDescriptions)) |
|
91 |
+ $this->errorDescription = $allErrorDescriptions[$errorCode]; |
|
92 |
+ |
|
93 |
+ $this->LogError($errorCode); |
|
94 |
+ } |
|
95 |
+ private function LogError($errorCode) |
|
96 |
+ { |
|
97 |
+ $this->_config = new Config(); |
|
98 |
+ if(!$this->_config->logError) |
|
99 |
+ { |
|
100 |
+ return; |
|
101 |
+ } |
|
102 |
+ |
|
103 |
+ } |
|
104 |
+} |
|
0 | 105 |
\ No newline at end of file |
... | ... |
@@ -0,0 +1,178 @@ |
1 |
+<?php |
|
2 |
+/** |
|
3 |
+ * User: dev |
|
4 |
+ * Date: 3/13/14 |
|
5 |
+ * Time: 9:21 AM |
|
6 |
+ */ |
|
7 |
+ |
|
8 |
+namespace Blackjack\Objects; |
|
9 |
+ |
|
10 |
+require_once 'Card.php'; |
|
11 |
+require_once 'Error.php'; |
|
12 |
+ |
|
13 |
+define('BJ_HAND_LOST', 1023); |
|
14 |
+define('BJ_HAND_IN_PROGRESS', 1024); |
|
15 |
+define('BJ_HAND_STAND', 1025); |
|
16 |
+define('BJ_HAND_DRAW', 1026); |
|
17 |
+define('BJ_HAND_WON', 1027); |
|
18 |
+ |
|
19 |
+class Hand { |
|
20 |
+ //Cards and sum is public so that json_encode can serialize it |
|
21 |
+ public $cards = array(); |
|
22 |
+ //Sum has to be kept public because value of 'A' can change. |
|
23 |
+ public $sum = 0; |
|
24 |
+ public $handState = BJ_HAND_IN_PROGRESS; |
|
25 |
+ private $isHard = true; |
|
26 |
+ private $isSplit = false; |
|
27 |
+ private $isLocked = false; |
|
28 |
+ //Aces change their value depending on hand. |
|
29 |
+ //Instead of searching the hand every time when a card is added, |
|
30 |
+ //store ace indexes to revisit them when sum is greater than 21. |
|
31 |
+ private $aceIndexes = array(); |
|
32 |
+ |
|
33 |
+ public function AddCard(Card $card) |
|
34 |
+ { |
|
35 |
+ if($this->isLocked) |
|
36 |
+ return new Error(E_BJ_HAND_LOCKED); |
|
37 |
+ elseif($this->handState != BJ_HAND_IN_PROGRESS) |
|
38 |
+ return new Error(E_BJ_HAND_UNPLAYABLE); |
|
39 |
+ |
|
40 |
+ if($card != null) |
|
41 |
+ array_push($this->cards, $card); |
|
42 |
+ $this->sum += $card->valueActual; |
|
43 |
+ |
|
44 |
+ //IF we are dealt an Ace, decide what the value of hand should be |
|
45 |
+ //while considering all the aces in the hand. |
|
46 |
+ //Following are blackjacks |
|
47 |
+ //11 aces |
|
48 |
+ //10, 1 ace |
|
49 |
+ //10, ace, 10 |
|
50 |
+ //8, ace, J |
|
51 |
+ if($card->valueFace == 'A') |
|
52 |
+ { |
|
53 |
+ array_push($this->aceIndexes, count($this->cards) - 1); |
|
54 |
+ |
|
55 |
+ //Check if treating this card as 11 would help us or not. |
|
56 |
+ if($this->sum + 10 <= 21) |
|
57 |
+ { |
|
58 |
+ $this->isHard = false; |
|
59 |
+ $card->valueActual += 10; |
|
60 |
+ $this->sum += 10; |
|
61 |
+ } |
|
62 |
+ } |
|
63 |
+ elseif($this->sum > 21 && count($this->aceIndexes) > 1) |
|
64 |
+ { |
|
65 |
+ //If sum is going over 21, and there are any aces in the hand |
|
66 |
+ //reduce their value to live happily ever after. |
|
67 |
+ for($aceIndex =0; $aceIndex < count($this->aceIndexes) && $this->sum > 21; $aceIndex++) |
|
68 |
+ { |
|
69 |
+ //no need to reduce value of ace if it is already 1. |
|
70 |
+ if($this->cards[$aceIndex]->valueActual == 11) |
|
71 |
+ { |
|
72 |
+ $this->cards[$aceIndex]->valueActual -= 10; |
|
73 |
+ $this->sum -= 10; |
|
74 |
+ } //enf of if |
|
75 |
+ } //end of for loop |
|
76 |
+ } // end of elseif |
|
77 |
+ |
|
78 |
+ //if sum has gone over 21, set the state to lost |
|
79 |
+ if($this->sum > 21) |
|
80 |
+ $this->handState = BJ_HAND_LOST; |
|
81 |
+ |
|
82 |
+ return true; |
|
83 |
+ } // end of function AddCard |
|
84 |
+ |
|
85 |
+ public function CanSplit() |
|
86 |
+ { |
|
87 |
+ return !$this->isLocked |
|
88 |
+ && (count($this->cards) == 2) |
|
89 |
+ && ($this->cards[0]->valueFace == $this->cards[1]->valueFace) |
|
90 |
+ && $this->handState == BJ_HAND_IN_PROGRESS; |
|
91 |
+ } |
|
92 |
+ |
|
93 |
+ public function GetSum() |
|
94 |
+ { |
|
95 |
+ return $this->sum; |
|
96 |
+ } |
|
97 |
+ |
|
98 |
+ public function IsBlackjack() |
|
99 |
+ { |
|
100 |
+ if (count($this->cards) == 2 && $this->sum == 21 && !$this->isSplit) |
|
101 |
+ return true; |
|
102 |
+ |
|
103 |
+ return false; |
|
104 |
+ } |
|
105 |
+ |
|
106 |
+ public function IsHard() |
|
107 |
+ { |
|
108 |
+ return $this->isHard; |
|
109 |
+ } |
|
110 |
+ |
|
111 |
+ public function IsSoft() |
|
112 |
+ { |
|
113 |
+ return !$this->isHard; |
|
114 |
+ } |
|
115 |
+ |
|
116 |
+ public function Split() |
|
117 |
+ { |
|
118 |
+ if (!$this->CanSplit()) |
|
119 |
+ { |
|
120 |
+ $error = new Error(E_BJ_CANNOT_SPLIT); |
|
121 |
+ return array($error, $error); |
|
122 |
+ } |
|
123 |
+ |
|
124 |
+ $this->isSplit = true; |
|
125 |
+ $cardForNewHand = array_pop($this->cards); |
|
126 |
+ $newHand = new Hand(true); |
|
127 |
+ $newHand->AddCard($cardForNewHand); |
|
128 |
+ |
|
129 |
+ return array($this, $newHand); |
|
130 |
+ } |
|
131 |
+ |
|
132 |
+ public function IsSplit() |
|
133 |
+ { |
|
134 |
+ return $this->isSplit; |
|
135 |
+ } |
|
136 |
+ |
|
137 |
+ public function IsBusted() |
|
138 |
+ { |
|
139 |
+ return $this->sum > 21; |
|
140 |
+ } |
|
141 |
+ |
|
142 |
+ public function IsLocked() |
|
143 |
+ { |
|
144 |
+ return $this->isLocked; |
|
145 |
+ } |
|
146 |
+ |
|
147 |
+ public function SetLocked() |
|
148 |
+ { |
|
149 |
+ $this->isLocked = true; |
|
150 |
+ } |
|
151 |
+ |
|
152 |
+ public function Lock() |
|
153 |
+ { |
|
154 |
+ $this->isLocked = true; |
|
155 |
+ } |
|
156 |
+ |
|
157 |
+ public function SetState($stateConstant) |
|
158 |
+ { |
|
159 |
+ //That's why lack of types suck... because you have to do with hacks like if statements :/ |
|
160 |
+ //Otherwise enum would have been so cool here!! |
|
161 |
+ if($stateConstant < BJ_HAND_LOST || $stateConstant > BJ_HAND_WON) |
|
162 |
+ return new Error(E_BJ_UNKNOWN_HAND_STATE); |
|
163 |
+ |
|
164 |
+ $this->handState = $stateConstant; |
|
165 |
+ return true; |
|
166 |
+ } |
|
167 |
+ |
|
168 |
+ public function GetState() |
|
169 |
+ { |
|
170 |
+ return $this->handState; |
|
171 |
+ } |
|
172 |
+ |
|
173 |
+ public function __construct($isSplit = false) |
|
174 |
+ { |
|
175 |
+ $this->isSplit = $isSplit; |
|
176 |
+ } |
|
177 |
+ |
|
178 |
+} |
|
0 | 179 |
\ No newline at end of file |
... | ... |
@@ -0,0 +1,101 @@ |
1 |
+<?php |
|
2 |
+/** |
|
3 |
+ * User: dev |
|
4 |
+ * Date: 3/13/14 |
|
5 |
+ * Time: 9:45 AM |
|
6 |
+ */ |
|
7 |
+ |
|
8 |
+namespace Blackjack\Objects; |
|
9 |
+ |
|
10 |
+use Blackjack\Config\Config; |
|
11 |
+ |
|
12 |
+require_once 'PlayerBase.php'; |
|
13 |
+ |
|
14 |
+class Player extends PlayerBase |
|
15 |
+{ |
|
16 |
+ public function __construct(Config $config, Hand $hand, $name) |
|
17 |
+ { |
|
18 |
+ parent::__construct($config, $hand, $name); |
|
19 |
+ } |
|
20 |
+ |
|
21 |
+ public function DoubleDown($handIndex, Card $card) |
|
22 |
+ { |
|
23 |
+ $isHandValid = $this->ValidateHandIndex($handIndex); |
|
24 |
+ if($isHandValid instanceof Error) |
|
25 |
+ return $isHandValid; |
|
26 |
+ |
|
27 |
+ //TODO: Double the bet. |
|
28 |
+ |
|
29 |
+ $isSuccessfullyAdded = $this->hands[$handIndex]->AddCard($card); |
|
30 |
+ |
|
31 |
+ if($isSuccessfullyAdded) |
|
32 |
+ $this->hands[$handIndex]->Lock(); |
|
33 |
+ |
|
34 |
+ return $isSuccessfullyAdded; |
|
35 |
+ } |
|
36 |
+ |
|
37 |
+ public function CanSplit($handIndex) |
|
38 |
+ { |
|
39 |
+ $isHandValid = $this->ValidateHandIndex($handIndex); |
|
40 |
+ if($isHandValid instanceof Error) |
|
41 |
+ return $isHandValid; |
|
42 |
+ |
|
43 |
+ $maxHandsPerPlayer = $this->config->maxHandsPerPlayer; |
|
44 |
+ |
|
45 |
+ if(count($this->hands) < $maxHandsPerPlayer && $this->hands[$handIndex]->CanSplit()) |
|
46 |
+ return true; |
|
47 |
+ |
|
48 |
+ return false; |
|
49 |
+ } |
|
50 |
+ |
|
51 |
+ public function SplitHand($handIndex, Card $newCard1, Card $newCard2) |
|
52 |
+ { |
|
53 |
+ $isHandValid = $this->ValidateHandIndex($handIndex); |
|
54 |
+ if($isHandValid instanceof Error) |
|
55 |
+ return $isHandValid; |
|
56 |
+ |
|
57 |
+ if(!$this->CanSplit($handIndex)) |
|
58 |
+ return new Error(E_BJ_CANNOT_SPLIT); |
|
59 |
+ |
|
60 |
+ list($newHand1, $newHand2) = $this->hands[$handIndex]->Split(); |
|
61 |
+ |
|
62 |
+ if(get_class($newHand2) == BJ_ERROR_CLASS_NAME) |
|
63 |
+ return $newHand2; |
|
64 |
+ |
|
65 |
+ //Add one card into each hand now. |
|
66 |
+ $isSuccessfullyAddedToHand1 = $newHand1->AddCard($newCard1); |
|
67 |
+ |
|
68 |
+ if($isSuccessfullyAddedToHand1) |
|
69 |
+ { |
|
70 |
+ $isSuccessfullyAddedToHand2 = $newHand2->AddCard($newCard2); |
|
71 |
+ |
|
72 |
+ if($isSuccessfullyAddedToHand2) |
|
73 |
+ { |
|
74 |
+ $this->hands[$handIndex] = $newHand1; |
|
75 |
+ array_push($this->hands, $newHand2); |
|
76 |
+ } |
|
77 |
+ else |
|
78 |
+ { |
|
79 |
+ return $isSuccessfullyAddedToHand2; |
|
80 |
+ } |
|
81 |
+ } |
|
82 |
+ |
|
83 |
+ //Control would reach here with $isSuccessfullyAddedToHand1 as true only if we could add to both |
|
84 |
+ //hands successfully. |
|
85 |
+ return $isSuccessfullyAddedToHand1; |
|
86 |
+ } |
|
87 |
+ |
|
88 |
+ public function GetHand($handIndex) |
|
89 |
+ { |
|
90 |
+ $isHandValid = $this->ValidateHandIndex($handIndex); |
|
91 |
+ if($isHandValid instanceof Error) |
|
92 |
+ return $isHandValid; |
|
93 |
+ |
|
94 |
+ return $this->hands[$handIndex]; |
|
95 |
+ } |
|
96 |
+ |
|
97 |
+ public function DeleteHand($handIndex) |
|
98 |
+ { |
|
99 |
+ unset($this->hands[$handIndex]); |
|
100 |
+ } |
|
101 |
+} |
... | ... |
@@ -0,0 +1,57 @@ |
1 |
+<?php |
|
2 |
+/** |
|
3 |
+ * User: dev |
|
4 |
+ * Date: 3/16/14 |
|
5 |
+ * Time: 10:52 PM |
|
6 |
+ */ |
|
7 |
+ |
|
8 |
+namespace Blackjack\Objects; |
|
9 |
+ |
|
10 |
+require_once 'Config/Config.php'; |
|
11 |
+require_once 'Hand.php'; |
|
12 |
+require_once 'Card.php'; |
|
13 |
+ |
|
14 |
+use Blackjack\Config\Config; |
|
15 |
+ |
|
16 |
+class PlayerBase { |
|
17 |
+ //This needs to be public to allow json_encode to serialize it. |
|
18 |
+ public $hands = array(); |
|
19 |
+ protected $name = ''; |
|
20 |
+ protected $config; |
|
21 |
+ |
|
22 |
+ public function __construct(Config $config, Hand $hand, $name) |
|
23 |
+ { |
|
24 |
+ $this->name = $name; |
|
25 |
+ $this->config = $config; |
|
26 |
+ array_push($this->hands, $hand); |
|
27 |
+ } |
|
28 |
+ |
|
29 |
+ public function GetName() |
|
30 |
+ { |
|
31 |
+ return $this->name; |
|
32 |
+ } |
|
33 |
+ |
|
34 |
+ public function GetHands() |
|
35 |
+ { |
|
36 |
+ return $this->hands; |
|
37 |
+ } |
|
38 |
+ |
|
39 |
+ |
|
40 |
+ protected function ValidateHandIndex($index) |
|
41 |
+ { |
|
42 |
+ //Hands can be deleted too when it has lost. |
|
43 |
+ if(!array_key_exists($index, $this->hands)) |
|
44 |
+ return new Error(E_BJ_HAND_BAD_INDEX); |
|
45 |
+ |
|
46 |
+ return true; |
|
47 |
+ } |
|
48 |
+ |
|
49 |
+ public function Hit($handIndex, Card $card) |
|
50 |
+ { |
|
51 |
+ $isHandValid = $this->ValidateHandIndex($handIndex); |
|
52 |
+ if($isHandValid instanceof Error) |
|
53 |
+ return $isHandValid; |
|
54 |
+ |
|
55 |
+ return $this->hands[$handIndex]->AddCard($card); |
|
56 |
+ } |
|
57 |
+} |
|
0 | 58 |
\ No newline at end of file |
... | ... |
@@ -0,0 +1,50 @@ |
1 |
+<?php |
|
2 |
+/** |
|
3 |
+ * User: dev |
|
4 |
+ * Date: 3/11/14 |
|
5 |
+ * Time: 8:58 AM |
|
6 |
+ */ |
|
7 |
+ |
|
8 |
+namespace Blackjack\Objects; |
|
9 |
+ |
|
10 |
+ |
|
11 |
+class Request { |
|
12 |
+ private $_parameterToUriPartMapping = array( |
|
13 |
+ 'sessionId', |
|
14 |
+ 'command' |
|
15 |
+ ); |
|
16 |
+ |
|
17 |
+ private $_uriParts = array( |
|
18 |
+ 'sessionId' => 'login', |
|
19 |
+ 'command' => 'login' |
|
20 |
+ ); |
|
21 |
+ |
|
22 |
+ function __construct($request='') |
|
23 |
+ { |
|
24 |
+ $request = urldecode($request); |
|
25 |
+ if ('' == $request) |
|
26 |
+ { |
|
27 |
+ $request = $_SERVER['REQUEST_URI']; |
|
28 |
+ } |
|
29 |
+ |
|
30 |
+ $uriParts = explode('/', $request); |
|
31 |
+ |
|
32 |
+ for($i=0; $i<count($this->_parameterToUriPartMapping); $i++) |
|
33 |
+ { |
|
34 |
+ $this->_uriParts[$this->_parameterToUriPartMapping[$i]] = $uriParts[$i]; |
|
35 |
+ } |
|
36 |
+ } |
|
37 |
+ |
|
38 |
+ function __get($key) |
|
39 |
+ { |
|
40 |
+ if (!array_key_exists($key, $this->_uriParts)) |
|
41 |
+ { |
|
42 |
+ return null; |
|
43 |
+ } |
|
44 |
+ |
|
45 |
+ return $this->_uriParts[$key]; |
|
46 |
+ } |
|
47 |
+ |
|
48 |
+ |
|
49 |
+ |
|
50 |
+} |
|
0 | 51 |
\ No newline at end of file |
... | ... |
@@ -0,0 +1,22 @@ |
1 |
+<?php |
|
2 |
+/** |
|
3 |
+ * User: dev |
|
4 |
+ * Date: 3/11/14 |
|
5 |
+ * Time: 9:22 AM |
|
6 |
+ */ |
|
7 |
+ |
|
8 |
+namespace Blackjack\Objects; |
|
9 |
+ |
|
10 |
+ |
|
11 |
+class Response { |
|
12 |
+ public $response; |
|
13 |
+ public $error; |
|
14 |
+ public $isSessionEnded; |
|
15 |
+ |
|
16 |
+ function __construct($responseObj, $error, $sessionEnded) |
|
17 |
+ { |
|
18 |
+ $this->error = $error; |
|
19 |
+ $this->response = $responseObj; |
|
20 |
+ $this->isSessionEnded = $sessionEnded; |
|
21 |
+ } |
|
22 |
+} |
|
0 | 23 |
\ No newline at end of file |
... | ... |
@@ -0,0 +1,73 @@ |
1 |
+<?php |
|
2 |
+/** |
|
3 |
+ * User: dev |
|
4 |
+ * Date: 3/13/14 |
|
5 |
+ * Time: 9:27 AM |
|
6 |
+ */ |
|
7 |
+ |
|
8 |
+namespace Blackjack\Objects; |
|
9 |
+ |
|
10 |
+require_once 'Deck.php'; |
|
11 |
+require_once 'Config/Config.php'; |
|
12 |
+ |
|
13 |
+use Blackjack\Config\Config; |
|
14 |
+ |
|
15 |
+class Shoe { |
|
16 |
+ private $cards = array(); |
|
17 |
+ private $numDecks; |
|
18 |
+ private $numCardsPicked = 0; |
|
19 |
+ private $config; |
|
20 |
+ |
|
21 |
+ public function __construct(Config $config) |
|
22 |
+ { |
|
23 |
+ $this->config = $config; |
|
24 |
+ $this->numDecks = mt_rand(1, $config->maxNumDecks); |
|
25 |
+ |
|
26 |
+ for($i = 0; $i < $this->numDecks; $i++) |
|
27 |
+ { |
|
28 |
+ $deck = new Deck(); |
|
29 |
+ $deck->Shuffle(); |
|
30 |
+ $this->cards = array_merge($this->cards, $deck->cards); |
|
31 |
+ } |
|
32 |
+ } |
|
33 |
+ |
|
34 |
+ public function PickCard() |
|
35 |
+ { |
|
36 |
+ if($this->NumCardsInShoe() == 0) |
|
37 |
+ throw new \InvalidArgumentException("No more cards in the shoe."); |
|
38 |
+ |
|
39 |
+ //Reshuffle if 10% cards have been picked. |
|
40 |
+ if($this->numCardsPicked >= count($this->cards) * $this->config->cardShuffleFraction) |
|
41 |
+ { |
|
42 |
+ $this->numCardsPicked = 0; |
|
43 |
+ $this->Shuffle(); |
|
44 |
+ } |
|
45 |
+ $lastShoeIndex = count($this->cards) - 1; |
|
46 |
+ $index = mt_rand(0, $lastShoeIndex); |
|
47 |
+ $card = $this->cards[$index]; |
|
48 |
+ //Unsetting values will not reassign the indexes... causing problems. |
|
49 |
+ //Hence copying over the last value to the value that needs to be deleted |
|
50 |
+ //and popping the last value. End result would be same for last value. |
|
51 |
+ $this->cards[$index] = $this->cards[$lastShoeIndex]; |
|
52 |
+ array_pop($this->cards); |
|
53 |
+ $this->numCardsPicked++; |
|
54 |
+ return $card; |
|
55 |
+ } |
|
56 |
+ |
|
57 |
+ public function NumCardsInShoe() |
|
58 |
+ { |
|
59 |
+ return count($this->cards); |
|
60 |
+ } |
|
61 |
+ |
|
62 |
+ private function Shuffle() |
|
63 |
+ { |
|
64 |
+ // http://blog.codinghorror.com/the-danger-of-naivete/ |
|
65 |
+ for ($i = count($this->cards) - 1; $i > 0; $i--) |
|
66 |
+ { |
|
67 |
+ $nextRandomPosition = mt_rand(0, $i); |
|
68 |
+ $cardSwapSpace = $this->cards[$i]; |
|
69 |
+ $this->cards[$i] = $this->cards[$nextRandomPosition]; |
|
70 |
+ $this->cards[$nextRandomPosition] = $cardSwapSpace; |
|
71 |
+ } |
|
72 |
+ } |
|
73 |
+} |
|
0 | 74 |
\ No newline at end of file |
... | ... |
@@ -0,0 +1,49 @@ |
1 |
+<?php |
|
2 |
+namespace Blackjack\UI; |
|
3 |
+ |
|
4 |
+require_once '../Config/Config.php'; |
|
5 |
+require_once '../Objects/Player.php'; |
|
6 |
+ |
|
7 |
+ |
|
8 |
+use Blackjack\Objects\Player as Player; |
|
9 |
+use Blackjack\Config\Config as Config; |
|
10 |
+ |
|
11 |
+$errorString=''; |
|
12 |
+ if(array_key_exists('btnSave', $_REQUEST)) |
|
13 |
+ { |
|
14 |
+ $config = new Config(); |
|
15 |
+ |
|
16 |
+ $name = trim(urldecode($_REQUEST['playerName'])); |
|
17 |
+ $nameLength = strlen($name); |
|
18 |
+ |
|
19 |
+ if($nameLength > $config->maxNameLength || $nameLength == 0) |
|
20 |
+ { |
|
21 |
+ $errorString = "Please enter a name that is max ".$config->maxNameLength." characters long."; |
|
22 |
+ } |
|
23 |
+ else |
|
24 |
+ { |
|
25 |
+ session_start(); |
|
26 |
+ session_regenerate_id(true); |
|
27 |
+ $_SESSION['player'] = new Player($config, $name); |
|
28 |
+ header('Location: table.php'); |
|
29 |
+ exit(); |
|
30 |
+ } |
|
31 |
+ } |
|
32 |
+?> |
|
33 |
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|
34 |
+<html> |
|
35 |
+<head> |
|
36 |
+ <title>Blackjack | Get Name</title> |
|
37 |
+ <link type="text/css" rel="stylesheet" href="style/bjstyles.css"></link> |
|
38 |
+</head> |
|
39 |
+<body class="themeBasic"> |
|
40 |
+ <form action="name.php"> |
|
41 |
+ <p>Please enter your name here:</p> |
|
42 |
+ <input type='text' name='playerName' id='playerName' value='' maxlength="15" /> |
|
43 |
+ <input type='submit' name='btnSave' id='btnSave' value='Save' /> |
|
44 |
+ <p class="error"> |
|
45 |
+ <?php echo $errorString; ?> |
|
46 |
+ </p> |
|
47 |
+ </form> |
|
48 |
+</body> |
|
49 |
+</html> |
|
0 | 50 |
\ No newline at end of file |
... | ... |
@@ -0,0 +1,78 @@ |
1 |
+<?php |
|
2 |
+namespace Blackjack\UI; |
|
3 |
+ |
|
4 |
+require_once '../Config/Config.php'; |
|
5 |
+require_once '../Objects/Player.php'; |
|
6 |
+ |
|
7 |
+ |
|
8 |
+use Blackjack\Objects\Player as Player; |
|
9 |
+use Blackjack\Config\Config as Config; |
|
10 |
+ |
|
11 |
+if(session_id()=='') |
|
12 |
+ session_start(); |
|
13 |
+$playerName = $_SESSION['player']->GetName(); |
|
14 |
+$errorString=''; |
|
15 |
+if(array_key_exists('btnSave', $_REQUEST)) |
|
16 |
+{ |
|
17 |
+ $config = new Config(); |
|
18 |
+ |
|
19 |
+ $name = trim(urldecode($_REQUEST['playerName'])); |
|
20 |
+ $nameLength = strlen($name); |
|
21 |
+ |
|
22 |
+ if($nameLength > $config->maxNameLength || $nameLength == 0) |
|
23 |
+ { |
|
24 |
+ $errorString = "Please enter a name that is max ".$config->maxNameLength." characters long."; |
|
25 |
+ } |
|
26 |
+ else |
|
27 |
+ { |
|
28 |
+ |
|
29 |
+ session_regenerate_id(true); |
|
30 |
+ $_SESSION['player'] = new Player($config, $name); |
|
31 |
+ header('Location: table.php'); |
|
32 |
+ exit(); |
|
33 |
+ } |
|
34 |
+} |
|
35 |
+?> |
|
36 |
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|
37 |
+<html> |
|
38 |
+<head> |
|
39 |
+ <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'></meta> |
|
40 |
+ <title>Blackjack | Table</title> |
|
41 |
+ <link type="text/css" rel="stylesheet" href="style/bjstyles.css"></link> |
|
42 |
+</head> |
|
43 |
+<body class="themeBasic"> |
|
44 |
+ <table id="bjTable"> |
|
45 |
+ <thead> |
|
46 |
+ <tr> |
|
47 |
+ <td><h1>Blackjack</h1></td> |
|
48 |
+ </tr> |
|
49 |
+ </thead> |
|
50 |
+ <tbody> |
|
51 |
+ <tr id="trDealerName"> |
|
52 |
+ <td> |
|
53 |
+ <h2>Dealer</h2> |
|
54 |
+ </td> |
|
55 |
+ </tr> |
|
56 |
+ <tr id="trDealerHand"> |
|
57 |
+ <td id="tdDealerHand"> |
|
58 |
+ |
|
59 |
+ </td> |
|
60 |
+ </tr> |
|
61 |
+ <tr id="trPlayerName"> |
|
62 |
+ <td id="tdPlayerName"> |
|
63 |
+ <h2><?php echo $playerName; ?></h2> |
|
64 |
+ </td> |
|
65 |
+ </tr> |
|
66 |
+ <tr id="trError"> |
|
67 |
+ <td id="tdError" class="error"> |
|
68 |
+ <?php echo $errorString; ?> |
|
69 |
+ </td> |
|
70 |
+ </tr> |
|
71 |
+ <tr id="trPlayerHands"> |
|
72 |
+ <td id="tdPlayerFirstHand"> |
|
73 |
+ |
|
74 |
+ </td> |
|
75 |
+ </tr> |
|
76 |
+ </tbody> |
|
77 |
+ </table> |
|
78 |
+</body> |
... | ... |
@@ -0,0 +1,144 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+require_once 'Config/Config.php'; |
|
4 |
+require_once 'Objects/Shoe.php'; |
|
5 |
+require_once 'Objects/Hand.php'; |
|
6 |
+require_once 'Objects/Response.php'; |
|
7 |
+require_once 'Blackjack.php'; |
|
8 |
+ |
|
9 |
+define('BJ_SESSION_KEY_TABLE', 'table'); |
|
10 |
+define('BJ_REQUEST_KEY_NAME', 'name'); |
|
11 |
+define('BJ_REQUEST_KEY_MOVE', 'move'); |
|
12 |
+define('BJ_REQUEST_KEY_HAND', 'handId'); |
|
13 |
+//$requestURI = explode('/', $_SERVER['REQUEST_URI']); |
|
14 |
+//$decodedUri = urldecode($_SERVER['REQUEST_URI']); |
|
15 |
+//$query = parse_url($decodedUri, PHP_URL_QUERY); |
|
16 |
+//var_dump($_SERVER); |
|
17 |
+//var_dump($_REQUEST); |
|
18 |
+//var_dump(session_id()); |
|
19 |
+ |
|
20 |
+function Debug() |
|
21 |
+{ |
|
22 |
+ //DEBUG HELPER |
|
23 |
+ if(!array_key_exists('d', $_REQUEST)) |
|
24 |
+ return; |
|
25 |
+ |
|
26 |
+ if(array_key_exists('cs', $_REQUEST)) |
|
27 |
+ { |
|
28 |
+ //clear session |
|
29 |
+ if(session_id() == '') |
|
30 |
+ session_start(); |
|
31 |
+ |
|
32 |
+ session_unset(); |
|
33 |
+ session_destroy(); |
|
34 |
+ } |
|
35 |
+} |
|
36 |
+ |
|
37 |
+function ValidateSession() |
|
38 |
+{ |
|
39 |
+ |
|
40 |
+} |
|
41 |
+function GetResponse() |
|
42 |
+{ |
|
43 |
+ //TODO: This function is looking huge and dirty now. Split it. |
|
44 |
+ $responseObject =null; |
|
45 |
+ $config = new \Blackjack\Config\Config(); |
|
46 |
+ if(session_id()=='') |
|
47 |
+ session_start(); |
|
48 |
+ |
|
49 |
+ Debug(); |
|
50 |
+ |
|
51 |
+ if(!array_key_exists(BJ_SESSION_KEY_TABLE, $_SESSION)) |
|
52 |
+ { |
|
53 |
+ if(!array_key_exists(BJ_REQUEST_KEY_NAME, $_REQUEST)) |
|
54 |
+ { |
|
55 |
+ //we don't have a session or a player name, that's an error. |
|
56 |
+ return new \Blackjack\Objects\Error(E_BJ_NO_NAME); |
|
57 |
+ } |
|
58 |
+ |
|
59 |
+ //Player is trying to start a new session |
|
60 |
+ $table = new \Blackjack\Blackjack($config, urldecode($_REQUEST[BJ_REQUEST_KEY_NAME])); |
|
61 |
+ //initialize and store it in the session for the user. |
|
62 |
+ $_SESSION[BJ_SESSION_KEY_TABLE] = $table; |
|
63 |
+ return $table; |
|
64 |
+ } |
|
65 |
+ //if a session exists, it will be resurrected without the name too. |
|
66 |
+ if(array_key_exists(BJ_REQUEST_KEY_MOVE, $_REQUEST)) |
|
67 |
+ { |
|
68 |
+ //Return an error if hand id is not specified, but a move is. |
|
69 |
+ if(!array_key_exists(BJ_REQUEST_KEY_HAND, $_REQUEST) || !is_numeric($_REQUEST[BJ_REQUEST_KEY_HAND])) |
|
70 |
+ { |
|
71 |
+ return new \Blackjack\Objects\Error(E_BJ_MOVE_NO_HAND_ID); |
|
72 |
+ } |
|
73 |
+ |
|
74 |
+ $table = $_SESSION[BJ_SESSION_KEY_TABLE]; |
|
75 |
+ $handIndex = $_REQUEST[BJ_REQUEST_KEY_HAND]; |
|
76 |
+ $isMoveSuccessful = true; |
|
77 |
+ switch($_REQUEST[BJ_REQUEST_KEY_MOVE]) |
|
78 |
+ { |
|
79 |
+ |
|
80 |
+ //REFERENCE GAME: http://www.games.com/play/masque-publishing/blackjack/single |
|
81 |
+ case 'hit': |
|
82 |
+ //Get a card from the shoe |
|
83 |
+ $card = $table->GetShoe()->PickCard(); |
|
84 |
+ //Add the card to the hand player wants. |
|
85 |
+ $isMoveSuccessful = $table->player->Hit($handIndex, $card); |
|
86 |
+ break; |
|
87 |
+ case 'split': |
|
88 |
+ //Check if we can split |
|
89 |
+ $canSplit = $table->player->CanSplit($handIndex); |
|
90 |
+ if($canSplit instanceof \Blackjack\Objects\Error) |
|
91 |
+ //Return an error if we got an error from CanSplit function. |
|
92 |
+ return $canSplit; |
|
93 |
+ elseif (!$canSplit) |
|
94 |
+ //Otherwise check the boolean and tell the player that we cannot split. |
|
95 |
+ new \Blackjack\Objects\Error(E_BJ_CANNOT_SPLIT); |
|
96 |
+ //Get two cards for hits on two hands |
|
97 |
+ $card1 = $table->GetShoe()->PickCard(); |
|
98 |
+ $card2 = $table->GetShoe()->PickCard(); |
|
99 |
+ //Split the hand and update the state of the table |
|
100 |
+ $isMoveSuccessful = $table->player->SplitHand($handIndex, $card1, $card2); |
|
101 |
+ break; |
|
102 |
+ case 'dd': |
|
103 |
+ //Get a card from the shoe |
|
104 |
+ $card = $table->GetShoe()->PickCard(); |
|
105 |
+ //DoubleDown with the card on the hand that user wants. |
|
106 |
+ $isMoveSuccessful = $table->player->DoubleDown($handIndex, $card); |
|
107 |
+ case 'stand': |
|
108 |
+ $isMoveSuccessful = $table->player->GetHand($handIndex)->SetState(BJ_HAND_STAND); |
|
109 |
+ $table->SetDealerTurn(); |
|
110 |
+ break; |
|
111 |
+ default: |
|
112 |
+ $isMoveSuccessful = new \Blackjack\Objects\Error(E_BJ_MOVE_UNKNOWN); |
|
113 |
+ } |
|
114 |
+ |
|
115 |
+ if($isMoveSuccessful instanceof \Blackjack\Objects\Error) |
|
116 |
+ return $isMoveSuccessful; |
|
117 |
+ |
|
118 |
+ $table->UpdateTableState($handIndex); |
|
119 |
+ |
|
120 |
+ return $table; |
|
121 |
+ |
|
122 |
+ } // end of move evaluator |
|
123 |
+ |
|
124 |
+ //return the table in the session if nothing else |
|
125 |
+ return $_SESSION[BJ_SESSION_KEY_TABLE]; |
|
126 |
+} |
|
127 |
+ |
|
128 |
+$responseObject = GetResponse(); |
|
129 |
+$response = new \Blackjack\Objects\Response($responseObject, $responseObject instanceof \Blackjack\Objects\Error, false); |
|
130 |
+header('Content-type: application/json'); |
|
131 |
+$jsonResponse = json_encode($response); |
|
132 |
+if($_SESSION[BJ_SESSION_KEY_TABLE]->GetTableState() == BJ_TABLE_ENDED) |
|
133 |
+{ |
|
134 |
+ //clear session |
|
135 |
+ if(session_id() == '') |
|
136 |
+ session_start(); |
|
137 |
+ |
|
138 |
+ session_unset(); |
|
139 |
+ session_destroy(); |
|
140 |
+ $response->isSessionEnded = true; |
|
141 |
+} |
|
142 |
+ |
|
143 |
+echo $jsonResponse; |
|
144 |
+?> |
|
0 | 145 |
\ No newline at end of file |
1 | 146 |