Skip to content
Browse files

ugh I cant ignore this crap...

  • Loading branch information...
1 parent 5fb72d7 commit e9344cca193f56dba0f363d8b51f922108f163e8 @jbass86 committed Nov 27, 2013
Showing with 0 additions and 19,780 deletions.
  1. +0 −38 .metadata/.plugins/org.eclipse.core.resources/.history/1/100bedd9fd4e00131a0bfd832dc8a3cb
  2. +0 −166 .metadata/.plugins/org.eclipse.core.resources/.history/1/206a74aff94f00131a0bfd832dc8a3cb
  3. +0 −86 .metadata/.plugins/org.eclipse.core.resources/.history/10/40240279234f00131a0bfd832dc8a3cb
  4. +0 −20 .metadata/.plugins/org.eclipse.core.resources/.history/10/b01a2c69ce5000131a0bfd832dc8a3cb
  5. +0 −13 .metadata/.plugins/org.eclipse.core.resources/.history/12/f006f704fc4e00131a0bfd832dc8a3cb
  6. +0 −237 .metadata/.plugins/org.eclipse.core.resources/.history/13/304d4e4ccb5000131a0bfd832dc8a3cb
  7. +0 −31 .metadata/.plugins/org.eclipse.core.resources/.history/16/d0029535fc4e00131a0bfd832dc8a3cb
  8. +0 −144 .metadata/.plugins/org.eclipse.core.resources/.history/17/901be433ca5000131a0bfd832dc8a3cb
  9. +0 −262 .metadata/.plugins/org.eclipse.core.resources/.history/19/00dbbc9ace5000131a0bfd832dc8a3cb
  10. +0 −175 .metadata/.plugins/org.eclipse.core.resources/.history/19/4071704ec85000131a0bfd832dc8a3cb
  11. +0 −228 .metadata/.plugins/org.eclipse.core.resources/.history/19/5066e320015000131a0bfd832dc8a3cb
  12. +0 −58 .metadata/.plugins/org.eclipse.core.resources/.history/1a/10bf3c9dd14f00131a0bfd832dc8a3cb
  13. +0 −29 .metadata/.plugins/org.eclipse.core.resources/.history/1c/f0161fd8ff4e00131a0bfd832dc8a3cb
  14. +0 −14 .metadata/.plugins/org.eclipse.core.resources/.history/1d/500edc9cca5000131a0bfd832dc8a3cb
  15. +0 −123 .metadata/.plugins/org.eclipse.core.resources/.history/1d/60732154ff4f00131a0bfd832dc8a3cb
  16. +0 −6 .metadata/.plugins/org.eclipse.core.resources/.history/1e/50e50a46035000131a0bfd832dc8a3cb
  17. +0 −185 .metadata/.plugins/org.eclipse.core.resources/.history/1f/908d5c91c85000131a0bfd832dc8a3cb
  18. +0 −45 .metadata/.plugins/org.eclipse.core.resources/.history/22/4057cca7155400131a0bfd832dc8a3cb
  19. 0 .metadata/.plugins/org.eclipse.core.resources/.history/22/b04a2335fb4e00131a0bfd832dc8a3cb
  20. +0 −203 .metadata/.plugins/org.eclipse.core.resources/.history/24/00b4ecdafe4f00131a0bfd832dc8a3cb
  21. +0 −159 .metadata/.plugins/org.eclipse.core.resources/.history/24/b0fb253df84f00131a0bfd832dc8a3cb
  22. +0 −57 .metadata/.plugins/org.eclipse.core.resources/.history/26/80ba0087225400131a0bfd832dc8a3cb
  23. +0 −103 .metadata/.plugins/org.eclipse.core.resources/.history/27/008cf22af44f00131a0bfd832dc8a3cb
  24. +0 −80 .metadata/.plugins/org.eclipse.core.resources/.history/2a/20969368cc5000131a0bfd832dc8a3cb
  25. +0 −108 .metadata/.plugins/org.eclipse.core.resources/.history/2a/90f3290cf34f00131a0bfd832dc8a3cb
  26. +0 −182 .metadata/.plugins/org.eclipse.core.resources/.history/2b/0028808bc85000131a0bfd832dc8a3cb
  27. +0 −108 .metadata/.plugins/org.eclipse.core.resources/.history/2c/40c51b2bfc4f00131a0bfd832dc8a3cb
  28. BIN .metadata/.plugins/org.eclipse.core.resources/.history/2e/d0ca24b2fe4f00131a0bfd832dc8a3cb
  29. +0 −63 .metadata/.plugins/org.eclipse.core.resources/.history/2e/e0faa333235400131a0bfd832dc8a3cb
  30. +0 −10 .metadata/.plugins/org.eclipse.core.resources/.history/2f/802892dcff4e00131a0bfd832dc8a3cb
  31. +0 −178 .metadata/.plugins/org.eclipse.core.resources/.history/3/c0064bf5fa4f00131a0bfd832dc8a3cb
  32. +0 −240 .metadata/.plugins/org.eclipse.core.resources/.history/3/d0d0f83e015000131a0bfd832dc8a3cb
  33. +0 −80 .metadata/.plugins/org.eclipse.core.resources/.history/30/6078ed73cc5000131a0bfd832dc8a3cb
  34. +0 −32 .metadata/.plugins/org.eclipse.core.resources/.history/30/b0b878e6d04f00131a0bfd832dc8a3cb
  35. +0 −39 .metadata/.plugins/org.eclipse.core.resources/.history/31/200007defd4e00131a0bfd832dc8a3cb
  36. +0 −43 .metadata/.plugins/org.eclipse.core.resources/.history/31/a03c3799145400131a0bfd832dc8a3cb
  37. +0 −159 .metadata/.plugins/org.eclipse.core.resources/.history/32/104fc78cf94f00131a0bfd832dc8a3cb
  38. +0 −244 .metadata/.plugins/org.eclipse.core.resources/.history/32/9076b1770e5000131a0bfd832dc8a3cb
  39. +0 −50 .metadata/.plugins/org.eclipse.core.resources/.history/32/c0038e1b225400131a0bfd832dc8a3cb
  40. +0 −201 .metadata/.plugins/org.eclipse.core.resources/.history/32/e0c6231fff4f00131a0bfd832dc8a3cb
  41. +0 −242 .metadata/.plugins/org.eclipse.core.resources/.history/35/2025531fcc5000131a0bfd832dc8a3cb
  42. +0 −32 .metadata/.plugins/org.eclipse.core.resources/.history/35/b0d8f8aa2b4f00131a0bfd832dc8a3cb
  43. 0 .metadata/.plugins/org.eclipse.core.resources/.history/38/10e358d1fe4e00131a0bfd832dc8a3cb
  44. +0 −45 .metadata/.plugins/org.eclipse.core.resources/.history/38/70894446155400131a0bfd832dc8a3cb
  45. +0 −184 .metadata/.plugins/org.eclipse.core.resources/.history/3b/c05cea5dfc4f00131a0bfd832dc8a3cb
  46. +0 −166 .metadata/.plugins/org.eclipse.core.resources/.history/3e/100e24defa4f00131a0bfd832dc8a3cb
  47. 0 .metadata/.plugins/org.eclipse.core.resources/.history/4/c0cd097cca5000131a0bfd832dc8a3cb
  48. +0 −163 .metadata/.plugins/org.eclipse.core.resources/.history/40/70a346a2c35000131a0bfd832dc8a3cb
  49. +0 −90 .metadata/.plugins/org.eclipse.core.resources/.history/42/c0633114255000131a0bfd832dc8a3cb
  50. +0 −64 .metadata/.plugins/org.eclipse.core.resources/.history/43/40da8813ce4f00131a0bfd832dc8a3cb
  51. +0 −199 .metadata/.plugins/org.eclipse.core.resources/.history/43/90988c75ff4f00131a0bfd832dc8a3cb
  52. +0 −16 .metadata/.plugins/org.eclipse.core.resources/.history/44/50a726f9cb5000131a0bfd832dc8a3cb
  53. +0 −87 .metadata/.plugins/org.eclipse.core.resources/.history/44/f061f9b8d04f00131a0bfd832dc8a3cb
  54. +0 −19 .metadata/.plugins/org.eclipse.core.resources/.history/46/7016af630e5000131a0bfd832dc8a3cb
  55. +0 −59 .metadata/.plugins/org.eclipse.core.resources/.history/47/c0a9ea8b225400131a0bfd832dc8a3cb
  56. +0 −11 .metadata/.plugins/org.eclipse.core.resources/.history/4b/20ce5a85fd4e00131a0bfd832dc8a3cb
  57. +0 −236 .metadata/.plugins/org.eclipse.core.resources/.history/4c/a0a9a435015000131a0bfd832dc8a3cb
  58. +0 −103 .metadata/.plugins/org.eclipse.core.resources/.history/4d/1075e520f44f00131a0bfd832dc8a3cb
  59. +0 −6 .metadata/.plugins/org.eclipse.core.resources/.history/4f/c05a1434035000131a0bfd832dc8a3cb
  60. +0 −92 .metadata/.plugins/org.eclipse.core.resources/.history/5/10214804f34f00131a0bfd832dc8a3cb
  61. +0 −138 .metadata/.plugins/org.eclipse.core.resources/.history/5/80f28662005000131a0bfd832dc8a3cb
  62. +0 −14 .metadata/.plugins/org.eclipse.core.resources/.history/51/70879ca2ca5000131a0bfd832dc8a3cb
  63. +0 −205 .metadata/.plugins/org.eclipse.core.resources/.history/53/30666127c95000131a0bfd832dc8a3cb
  64. +0 −11 .metadata/.plugins/org.eclipse.core.resources/.history/53/4074caf6cd4f00131a0bfd832dc8a3cb
  65. +0 −29 .metadata/.plugins/org.eclipse.core.resources/.history/53/50bb0c90234f00131a0bfd832dc8a3cb
  66. +0 −250 .metadata/.plugins/org.eclipse.core.resources/.history/53/90cd3488c85000131a0bfd832dc8a3cb
  67. +0 −52 .metadata/.plugins/org.eclipse.core.resources/.history/53/b0af6b5bd14f00131a0bfd832dc8a3cb
  68. +0 −10 .metadata/.plugins/org.eclipse.core.resources/.history/54/e0a371b3035000131a0bfd832dc8a3cb
  69. +0 −86 .metadata/.plugins/org.eclipse.core.resources/.history/55/50951c9dff4e00131a0bfd832dc8a3cb
  70. +0 −155 .metadata/.plugins/org.eclipse.core.resources/.history/55/d0f0bf6cc35000131a0bfd832dc8a3cb
  71. +0 −38 .metadata/.plugins/org.eclipse.core.resources/.history/55/e0a64b5ffe4e00131a0bfd832dc8a3cb
  72. +0 −56 .metadata/.plugins/org.eclipse.core.resources/.history/57/b0bc5dbafb4e00131a0bfd832dc8a3cb
  73. +0 −20 .metadata/.plugins/org.eclipse.core.resources/.history/59/f0e2fa063e5300131a0bfd832dc8a3cb
  74. +0 −152 .metadata/.plugins/org.eclipse.core.resources/.history/5c/403f949ec25000131a0bfd832dc8a3cb
  75. +0 −182 .metadata/.plugins/org.eclipse.core.resources/.history/5c/a08b564cfc4f00131a0bfd832dc8a3cb
  76. +0 −103 .metadata/.plugins/org.eclipse.core.resources/.history/5e/e0be37d3f34f00131a0bfd832dc8a3cb
  77. +0 −249 .metadata/.plugins/org.eclipse.core.resources/.history/5f/b009223ece5000131a0bfd832dc8a3cb
  78. +0 −103 .metadata/.plugins/org.eclipse.core.resources/.history/61/8044442ef34f00131a0bfd832dc8a3cb
  79. +0 −244 .metadata/.plugins/org.eclipse.core.resources/.history/64/9044c146255000131a0bfd832dc8a3cb
  80. +0 −235 .metadata/.plugins/org.eclipse.core.resources/.history/68/50fb0a2bcb5000131a0bfd832dc8a3cb
  81. +0 −101 .metadata/.plugins/org.eclipse.core.resources/.history/69/503ea21f025000131a0bfd832dc8a3cb
  82. +0 −145 .metadata/.plugins/org.eclipse.core.resources/.history/69/8098711bf84f00131a0bfd832dc8a3cb
  83. +0 −143 .metadata/.plugins/org.eclipse.core.resources/.history/6c/2098e097f44f00131a0bfd832dc8a3cb
  84. +0 −16 .metadata/.plugins/org.eclipse.core.resources/.history/6c/90374f4ccb5000131a0bfd832dc8a3cb
  85. +0 −105 .metadata/.plugins/org.eclipse.core.resources/.history/6c/f08fb78eb25100131a0bfd832dc8a3cb
  86. +0 −118 .metadata/.plugins/org.eclipse.core.resources/.history/6f/b0ccd335c15000131a0bfd832dc8a3cb
  87. +0 −43 .metadata/.plugins/org.eclipse.core.resources/.history/7/40d14d26145400131a0bfd832dc8a3cb
  88. +0 −141 .metadata/.plugins/org.eclipse.core.resources/.history/73/50ac9165c25000131a0bfd832dc8a3cb
  89. +0 −138 .metadata/.plugins/org.eclipse.core.resources/.history/75/10fe545eff4f00131a0bfd832dc8a3cb
  90. +0 −268 .metadata/.plugins/org.eclipse.core.resources/.history/75/a0f344cdce5000131a0bfd832dc8a3cb
  91. +0 −152 .metadata/.plugins/org.eclipse.core.resources/.history/75/d05e0238f84f00131a0bfd832dc8a3cb
  92. +0 −36 .metadata/.plugins/org.eclipse.core.resources/.history/77/10394bd0fd4e00131a0bfd832dc8a3cb
  93. +0 −5 .metadata/.plugins/org.eclipse.core.resources/.history/78/0037ce03ff4e00131a0bfd832dc8a3cb
  94. +0 −46 .metadata/.plugins/org.eclipse.core.resources/.history/78/00be669efe4e00131a0bfd832dc8a3cb
  95. +0 −128 .metadata/.plugins/org.eclipse.core.resources/.history/78/c07a9547f44f00131a0bfd832dc8a3cb
  96. +0 −279 .metadata/.plugins/org.eclipse.core.resources/.history/7c/10973d02cf5000131a0bfd832dc8a3cb
  97. +0 −275 .metadata/.plugins/org.eclipse.core.resources/.history/7c/10c3a2e9ce5000131a0bfd832dc8a3cb
  98. +0 −20 .metadata/.plugins/org.eclipse.core.resources/.history/7e/b05c7f1c004f00131a0bfd832dc8a3cb
  99. +0 −108 .metadata/.plugins/org.eclipse.core.resources/.history/7f/a03e0d09c15000131a0bfd832dc8a3cb
  100. +0 −187 .metadata/.plugins/org.eclipse.core.resources/.history/8/108aff28fe4f00131a0bfd832dc8a3cb
  101. +0 −63 .metadata/.plugins/org.eclipse.core.resources/.history/8/6004e53b235400131a0bfd832dc8a3cb
  102. +0 −232 .metadata/.plugins/org.eclipse.core.resources/.history/80/70d3042c015000131a0bfd832dc8a3cb
  103. +0 −15 .metadata/.plugins/org.eclipse.core.resources/.history/81/6080ca570e5000131a0bfd832dc8a3cb
  104. +0 −185 .metadata/.plugins/org.eclipse.core.resources/.history/85/a0feea9ac85000131a0bfd832dc8a3cb
  105. 0 .metadata/.plugins/org.eclipse.core.resources/.history/86/603612d3ff4e00131a0bfd832dc8a3cb
  106. +0 −56 .metadata/.plugins/org.eclipse.core.resources/.history/86/a02a8c7cfd4e00131a0bfd832dc8a3cb
  107. +0 −249 .metadata/.plugins/org.eclipse.core.resources/.history/87/b000486cce5000131a0bfd832dc8a3cb
  108. +0 −14 .metadata/.plugins/org.eclipse.core.resources/.history/89/40f5c19fcf4f00131a0bfd832dc8a3cb
  109. +0 −76 .metadata/.plugins/org.eclipse.core.resources/.history/8a/c04ec5c1fe4e00131a0bfd832dc8a3cb
  110. +0 −203 .metadata/.plugins/org.eclipse.core.resources/.history/8c/70b3fbedfe4f00131a0bfd832dc8a3cb
  111. +0 −39 .metadata/.plugins/org.eclipse.core.resources/.history/8e/0036e5dffd4e00131a0bfd832dc8a3cb
  112. +0 −229 .metadata/.plugins/org.eclipse.core.resources/.history/8f/507b49b4c95000131a0bfd832dc8a3cb
  113. +0 −108 .metadata/.plugins/org.eclipse.core.resources/.history/90/a066ffa8c05000131a0bfd832dc8a3cb
  114. +0 −10 .metadata/.plugins/org.eclipse.core.resources/.history/91/3065718aca5000131a0bfd832dc8a3cb
  115. +0 −80 .metadata/.plugins/org.eclipse.core.resources/.history/91/c0defc063e5300131a0bfd832dc8a3cb
  116. +0 −22 .metadata/.plugins/org.eclipse.core.resources/.history/92/10f9cd2cff4e00131a0bfd832dc8a3cb
  117. +0 −241 .metadata/.plugins/org.eclipse.core.resources/.history/92/b0b0a78ccb5000131a0bfd832dc8a3cb
  118. +0 −32 .metadata/.plugins/org.eclipse.core.resources/.history/93/4045b3ccfd4e00131a0bfd832dc8a3cb
  119. +0 −174 .metadata/.plugins/org.eclipse.core.resources/.history/93/f0b890bdc35000131a0bfd832dc8a3cb
  120. +0 −168 .metadata/.plugins/org.eclipse.core.resources/.history/94/107fbb81f44f00131a0bfd832dc8a3cb
  121. +0 −58 .metadata/.plugins/org.eclipse.core.resources/.history/94/208bc01aff4e00131a0bfd832dc8a3cb
  122. +0 −78 .metadata/.plugins/org.eclipse.core.resources/.history/95/908cff9bff4e00131a0bfd832dc8a3cb
  123. +0 −58 .metadata/.plugins/org.eclipse.core.resources/.history/95/f08721eccc4f00131a0bfd832dc8a3cb
  124. +0 −205 .metadata/.plugins/org.eclipse.core.resources/.history/97/90dbc7fac85000131a0bfd832dc8a3cb
  125. +0 −58 .metadata/.plugins/org.eclipse.core.resources/.history/98/70a76e14ff4e00131a0bfd832dc8a3cb
  126. +0 −30 .metadata/.plugins/org.eclipse.core.resources/.history/9a/e0b239bbfd4e00131a0bfd832dc8a3cb
  127. +0 −90 .metadata/.plugins/org.eclipse.core.resources/.history/9a/f02f967bc05000131a0bfd832dc8a3cb
  128. +0 −152 .metadata/.plugins/org.eclipse.core.resources/.history/9b/d031fe85f44f00131a0bfd832dc8a3cb
  129. +0 −17 .metadata/.plugins/org.eclipse.core.resources/.history/9d/20bc2d3f045000131a0bfd832dc8a3cb
  130. +0 −64 .metadata/.plugins/org.eclipse.core.resources/.history/a/502f161dcd4f00131a0bfd832dc8a3cb
  131. +0 −5 .metadata/.plugins/org.eclipse.core.resources/.history/a/d0ceb86efb4e00131a0bfd832dc8a3cb
  132. +0 −5 .metadata/.plugins/org.eclipse.core.resources/.history/a0/c0f51023145400131a0bfd832dc8a3cb
  133. +0 −284 .metadata/.plugins/org.eclipse.core.resources/.history/a1/10c9fe18cf5000131a0bfd832dc8a3cb
  134. +0 −235 .metadata/.plugins/org.eclipse.core.resources/.history/a1/40d4bb3ace5000131a0bfd832dc8a3cb
  135. +0 −211 .metadata/.plugins/org.eclipse.core.resources/.history/a4/50099742c95000131a0bfd832dc8a3cb
  136. +0 −185 .metadata/.plugins/org.eclipse.core.resources/.history/a4/e00466c4fc4f00131a0bfd832dc8a3cb
  137. +0 −129 .metadata/.plugins/org.eclipse.core.resources/.history/a5/f0a57156f44f00131a0bfd832dc8a3cb
  138. +0 −87 .metadata/.plugins/org.eclipse.core.resources/.history/a6/d0511d7d234f00131a0bfd832dc8a3cb
  139. +0 −141 .metadata/.plugins/org.eclipse.core.resources/.history/a8/80c8128ec25000131a0bfd832dc8a3cb
  140. +0 −43 .metadata/.plugins/org.eclipse.core.resources/.history/a9/8064cb01155400131a0bfd832dc8a3cb
  141. +0 −14 .metadata/.plugins/org.eclipse.core.resources/.history/aa/f02a549aca5000131a0bfd832dc8a3cb
  142. +0 −228 .metadata/.plugins/org.eclipse.core.resources/.history/ac/a08f8533005000131a0bfd832dc8a3cb
  143. +0 −79 .metadata/.plugins/org.eclipse.core.resources/.history/ac/b0d99459ca5000131a0bfd832dc8a3cb
  144. +0 −211 .metadata/.plugins/org.eclipse.core.resources/.history/ad/106af167c95000131a0bfd832dc8a3cb
  145. +0 −278 .metadata/.plugins/org.eclipse.core.resources/.history/ad/a041e3efce5000131a0bfd832dc8a3cb
  146. +0 −250 .metadata/.plugins/org.eclipse.core.resources/.history/af/60cf134e255000131a0bfd832dc8a3cb
  147. +0 −266 .metadata/.plugins/org.eclipse.core.resources/.history/b/801728a5ce5000131a0bfd832dc8a3cb
  148. +0 −108 .metadata/.plugins/org.eclipse.core.resources/.history/b0/b0222012f34f00131a0bfd832dc8a3cb
  149. +0 −65 .metadata/.plugins/org.eclipse.core.resources/.history/b2/b06b3723235400131a0bfd832dc8a3cb
  150. +0 −217 .metadata/.plugins/org.eclipse.core.resources/.history/b3/008e8781c95000131a0bfd832dc8a3cb
  151. +0 −18 .metadata/.plugins/org.eclipse.core.resources/.history/b3/202ff586fb4e00131a0bfd832dc8a3cb
  152. +0 −144 .metadata/.plugins/org.eclipse.core.resources/.history/b4/b0584c95f44f00131a0bfd832dc8a3cb
  153. +0 −237 .metadata/.plugins/org.eclipse.core.resources/.history/b4/f03acb5dcb5000131a0bfd832dc8a3cb
  154. +0 −125 .metadata/.plugins/org.eclipse.core.resources/.history/b5/60769f46c25000131a0bfd832dc8a3cb
  155. +0 −17 .metadata/.plugins/org.eclipse.core.resources/.history/b9/40911c79fb4e00131a0bfd832dc8a3cb
  156. +0 −45 .metadata/.plugins/org.eclipse.core.resources/.history/b9/50a6dc42155400131a0bfd832dc8a3cb
  157. +0 −127 .metadata/.plugins/org.eclipse.core.resources/.history/b9/60990d3ef44f00131a0bfd832dc8a3cb
  158. +0 −58 .metadata/.plugins/org.eclipse.core.resources/.history/ba/007a506cfe4e00131a0bfd832dc8a3cb
  159. +0 −77 .metadata/.plugins/org.eclipse.core.resources/.history/bb/10c5dabbd24f00131a0bfd832dc8a3cb
  160. +0 −228 .metadata/.plugins/org.eclipse.core.resources/.history/be/001127e2005000131a0bfd832dc8a3cb
  161. +0 −64 .metadata/.plugins/org.eclipse.core.resources/.history/bf/c0dc0a60235400131a0bfd832dc8a3cb
  162. +0 −58 .metadata/.plugins/org.eclipse.core.resources/.history/c/60f95885fd4e00131a0bfd832dc8a3cb
  163. +0 −14 .metadata/.plugins/org.eclipse.core.resources/.history/c0/00ca7c90ca5000131a0bfd832dc8a3cb
  164. +0 −199 .metadata/.plugins/org.eclipse.core.resources/.history/c0/6044572e005000131a0bfd832dc8a3cb
  165. +0 −174 .metadata/.plugins/org.eclipse.core.resources/.history/c2/20ec9fdac55000131a0bfd832dc8a3cb
  166. +0 −189 .metadata/.plugins/org.eclipse.core.resources/.history/c2/f0626bd3fc4f00131a0bfd832dc8a3cb
  167. +0 −8 .metadata/.plugins/org.eclipse.core.resources/.history/c3/806dfe58035000131a0bfd832dc8a3cb
  168. +0 −63 .metadata/.plugins/org.eclipse.core.resources/.history/c5/e0680159235400131a0bfd832dc8a3cb
  169. +0 −178 .metadata/.plugins/org.eclipse.core.resources/.history/c6/d01b9ce8fa4f00131a0bfd832dc8a3cb
  170. +0 −5 .metadata/.plugins/org.eclipse.core.resources/.history/c7/007ac1fdfb4e00131a0bfd832dc8a3cb
  171. +0 −5 .metadata/.plugins/org.eclipse.core.resources/.history/c7/4095d9a10c4f00131a0bfd832dc8a3cb
  172. +0 −145 .metadata/.plugins/org.eclipse.core.resources/.history/c7/a018aef1f44f00131a0bfd832dc8a3cb
  173. 0 .metadata/.plugins/org.eclipse.core.resources/.history/ca/408fb816145400131a0bfd832dc8a3cb
  174. +0 −20 .metadata/.plugins/org.eclipse.core.resources/.history/ca/5031a9c3fb4e00131a0bfd832dc8a3cb
  175. +0 −191 .metadata/.plugins/org.eclipse.core.resources/.history/cd/c00c41c6c85000131a0bfd832dc8a3cb
  176. +0 −179 .metadata/.plugins/org.eclipse.core.resources/.history/ce/70ec2317fc4f00131a0bfd832dc8a3cb
  177. +0 −80 .metadata/.plugins/org.eclipse.core.resources/.history/ce/d05804073e5300131a0bfd832dc8a3cb
  178. +0 −205 .metadata/.plugins/org.eclipse.core.resources/.history/d/9029cbfbfe4f00131a0bfd832dc8a3cb
  179. +0 −65 .metadata/.plugins/org.eclipse.core.resources/.history/d/b040aad6225400131a0bfd832dc8a3cb
  180. +0 −16 .metadata/.plugins/org.eclipse.core.resources/.history/d1/60adb25ece5000131a0bfd832dc8a3cb
Sorry, we could not display the entire diff because it was too big.
View
38 .metadata/.plugins/org.eclipse.core.resources/.history/1/100bedd9fd4e00131a0bfd832dc8a3cb
@@ -1,38 +0,0 @@
-package jtj_holdem.game.data_structures;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import jtj_holdem.game.data.Card;
-import jtj_holdem.game.enums.ECardNumber;
-import jtj_holdem.game.enums.ECardSuit;
-import jtj_holdem.game.interfaces.ICard;
-
-public class CardDeck {
-
- private final List <ICard> mDeck = new ArrayList<ICard>();
-
- public CardDeck(){}
-
- public void populateDeck(final boolean pShuffle){
-
- mDeck.clear();
-
- for (ECardNumber number : ECardNumber.values()){
-
- for (ECardSuit suit : ECardSuit.values()){
- Card aCard = new Card(number, suit);
- mDeck.add(aCard);
- }
- }
-
- if (pShuffle){
- shuffleDeck();
- }
- }
-
- public void shuffleDeck(){
-
-
- }
-}
View
166 .metadata/.plugins/org.eclipse.core.resources/.history/1/206a74aff94f00131a0bfd832dc8a3cb
@@ -1,166 +0,0 @@
-package jtj_holdem.game.utility;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import jtj_holdem.game.data_structures.PokerHand;
-import jtj_holdem.game.enums.ECardNumber;
-import jtj_holdem.game.enums.ECardSuit;
-import jtj_holdem.game.enums.EPokerHand;
-import jtj_holdem.game.interfaces.ICard;
-
-public class PokerHandUtility {
-
- public static EPokerHand determineBestHand(List<ICard> pHand){
-
- return null;
- }
-
- public static PokerHand determineFlush(List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
-
- Map<ECardSuit, List<ICard>> suits = new HashMap<ECardSuit, List<ICard>>();
- for (ECardSuit suit : ECardSuit.values()){
- suits.put(suit, new ArrayList<ICard>());
- }
-
- for (ICard card : pHand){
- suits.get(card.getSuit()).add(card);
- }
-
- for (ECardSuit suit : suits.keySet()){
- if (suits.get(suit).size() >= 5){
- hand = new PokerHand(EPokerHand.FLUSH, suits.get(suit), Collections.<ICard> emptyList());
- }
- }
- return hand;
- }
-
- public static PokerHand determineStraight(List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
-
- List<ICard> sortedList = new ArrayList<>(pHand);
- Collections.sort(sortedList);
-
- List<ICard> consecutiveCards = new ArrayList<ICard>();
- int lastNumber = 0;
- for (ICard card : sortedList){
- if (lastNumber > 0){
- if (card.getNumber().getNumber() == lastNumber + 1){
- consecutiveCards.add(card);
- }else if (card.getNumber().getNumber() != lastNumber){
- consecutiveCards.clear();
- }
- if (consecutiveCards.size() == 5){
- hand = new PokerHand(EPokerHand.STRAIGHT, consecutiveCards, Collections.<ICard> emptyList());
- break;
- }
- }else{
- //This is the very first card so just add it to our consecutive list
- //as we have nothing to compare it to yet.
- consecutiveCards.add(card);
- if (card.getNumber() == ECardNumber.TWO){
- //since two is our first we need to check for an ace and add it if its there.
- if (sortedList.get(sortedList.size() - 1).getNumber() == ECardNumber.ACE){
- consecutiveCards.add(sortedList.get(sortedList.size() - 1));
- }
- }
- }
- lastNumber = card.getNumber().getNumber();
- }
-
- return hand;
- }
-
- public static PokerHand determineFourOfAKind(final List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
- Map<ECardNumber, List<ICard>> numbers = organizeByNumber(pHand);
-
- for (ECardNumber number : numbers.keySet()){
- if (numbers.get(number).size() == 4){
- List <ICard> kickers = new ArrayList<ICard>(pHand);
- kickers.removeAll(numbers.get(number));
- hand = new PokerHand(EPokerHand.FOUR_OF_A_KIND, numbers.get(number), kickers);
- break;
- }
- }
-
- return hand;
- }
-
- public static PokerHand determineThreeOfAKind(final List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
- Map<ECardNumber, List<ICard>> numbers = organizeByNumber(pHand);
-
- for (ECardNumber number : numbers.keySet()){
- if (numbers.get(number).size() == 3){
- List <ICard> kickers = new ArrayList<ICard>(pHand);
- kickers.removeAll(numbers.get(number));
- hand = new PokerHand(EPokerHand.THREE_OF_A_KIND, numbers.get(number), kickers);
- break;
- }
- }
-
- return hand;
- }
-
- public static PokerHand determineTwoPair(final List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
- Map<ECardNumber, List<ICard>> numbers = organizeByNumber(pHand);
-
- List <ICard> pair1 = Collections.emptyList();
- List <ICard> pair2 = Collections.emptyList();
- for (ECardNumber number : numbers.keySet()){
- if (numbers.get(number).size() == 2){
- if (pair1.isEmpty()){
- pair1 = numbers.get(number);
- }else if (!pair1.isEmpty() && pair2.isEmpty()){
- pair2 = numbers.get(number);
- }
- }
- }
- if (!pair1.isEmpty() && !pair2.isEmpty()){
- List <ICard> pairs = new ArrayList<ICard>(pair1);
- pairs.addAll(pair2);
- List <ICard> kickers = new ArrayList<ICard>(pHand);
- kickers.removeAll(numbers.get(pairs));
- hand = new PokerHand(EPokerHand.TWO_PAIR, pairs, kickers);
- }
-
- return hand;
- }
-
- public static PokerHand determineOnePair(final List <ICard> pHand){
- PokerHand hand = PokerHand.INVALID;
- Map<ECardNumber, List<ICard>> numbers = organizeByNumber(pHand);
-
- List <ICard> pair = Collections.emptyList();
- for (ECardNumber number : numbers.keySet()){
- if (numbers.get(number).size() == 2){
-
- }
- }
-
- return hand;
- }
-
- private static Map<ECardNumber, List<ICard>> organizeByNumber(final List<ICard> pHand){
-
- Map<ECardNumber, List<ICard>> numbers = new HashMap<ECardNumber, List<ICard>>();
- for (ECardNumber number : ECardNumber.values()){
- numbers.put(number, new ArrayList<ICard>());
- }
- for (ICard card : pHand){
- numbers.get(card.getNumber()).add(card);
- }
- return numbers;
- }
-}
View
86 .metadata/.plugins/org.eclipse.core.resources/.history/10/40240279234f00131a0bfd832dc8a3cb
@@ -1,86 +0,0 @@
-package jtj_holdem.game.data_structures;
-
-import java.util.List;
-import java.util.Random;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import jtj_holdem.game.data.Card;
-import jtj_holdem.game.enums.ECardNumber;
-import jtj_holdem.game.enums.ECardSuit;
-import jtj_holdem.game.interfaces.ICard;
-
-public class CardDeck {
-
- private final List <ICard> mDeck = new CopyOnWriteArrayList<ICard>();
-
- public CardDeck(){}
-
- public void populateDeck(final boolean pShuffle){
-
- mDeck.clear();
-
- for (ECardNumber number : ECardNumber.values()){
-
- for (ECardSuit suit : ECardSuit.values()){
- Card aCard = new Card(number, suit);
- mDeck.add(aCard);
- }
- }
-
- if (pShuffle){
- shuffleDeck();
- }
- }
-
- public void shuffleDeck(){
-
- Random rand = new Random(System.currentTimeMillis());
-
- for (int i = 0; i < 500; i++){
-
- int number = rand.nextInt(mDeck.size());
- ICard card = mDeck.remove(number);
- mDeck.add(card);
- }
- }
-
- public ICard dealCard(){
- if (!mDeck.isEmpty()){
- return mDeck.remove(0);
- }else{
- return null;
- }
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((mDeck == null) ? 0 : mDeck.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- CardDeck other = (CardDeck) obj;
- if (mDeck == null) {
- if (other.mDeck != null)
- return false;
- } else if (!mDeck.equals(other.mDeck))
- return false;
- return true;
- }
-
- public void printDeck(){
-
- for (ICard card : mDeck){
- System.out.println(card);
- }
- }
-}
View
20 .metadata/.plugins/org.eclipse.core.resources/.history/10/b01a2c69ce5000131a0bfd832dc8a3cb
@@ -1,20 +0,0 @@
-package jtj_holdem.tests;
-
-import jtj_holdem.game.enums.ECardNumber;
-
-public class GeneralTest {
-
- public static void main(String[] args) {
- // TODO Auto-generated method stub
-
- System.out.println("General compare test");
- ECardNumber a = ECardNumber.TWO;
- ECardNumber b = ECardNumber.EIGHT;
- System.out.println(a.compareTo(b));
-
- for(ECardNumber number : ECardNumber.values()){
-
- }
- }
-
-}
View
13 .metadata/.plugins/org.eclipse.core.resources/.history/12/f006f704fc4e00131a0bfd832dc8a3cb
@@ -1,13 +0,0 @@
-package jtj_holdem.game.data_structures;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import jtj_holdem.game.interfaces.ICard;
-
-public class CardDeck {
-
- private final List <ICard> mDeck = new ArrayList<ICard>();
-
-
-}
View
237 .metadata/.plugins/org.eclipse.core.resources/.history/13/304d4e4ccb5000131a0bfd832dc8a3cb
@@ -1,237 +0,0 @@
-package jtj_holdem.game.data_structures;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import jtj_holdem.game.enums.ECardNumber;
-import jtj_holdem.game.enums.EPokerHand;
-import jtj_holdem.game.interfaces.ICard;
-import jtj_holdem.game.utility.PokerHandUtility;
-
-/**
- * A data structure containing the logical contents of a Poker Hand as well as all of the logic needed
- * in order to compare one hand against another.
- * @author Josh Bass
- *
- */
-public class PokerHand implements Comparable<PokerHand>{
-
- public static final PokerHand INVALID = new PokerHand(EPokerHand.NO_HAND, Collections.<ICard> emptyList(),
- Collections.<ICard> emptyList());
-
- private final EPokerHand mHand;
-
- private final List<ICard> mCards;
-
- private final List<ICard> mKickers;
-
- public PokerHand(final EPokerHand pHand, final List<ICard> pCards, final List<ICard> pKickers){
- mHand = pHand;
- mCards = pCards;
- mKickers = pKickers;
- }
-
- public EPokerHand getHand() {
- return mHand;
- }
-
- public List<ICard> getCards() {
- return mCards;
- }
-
- public List<ICard> getKickers() {
- return mKickers;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((mCards == null) ? 0 : mCards.hashCode());
- result = prime * result + ((mHand == null) ? 0 : mHand.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- PokerHand other = (PokerHand) obj;
- if (mCards == null) {
- if (other.mCards != null)
- return false;
- } else if (!mCards.equals(other.mCards))
- return false;
- if (mHand != other.mHand)
- return false;
- return true;
- }
-
- public boolean isValid(){
- return !this.equals(INVALID);
- }
-
- @Override
- public int compareTo(PokerHand pO) {
-
- if (getHand().compareTo(pO.getHand()) == 0){
- //both hands are the same so we have to get more technical.
-
- switch(mHand){
- case STRAIGHT_FLUSH:
- //straight flush should just follow the same rules as a straight
- return compareStraight(pO);
- case FOUR_OF_A_KIND:
- return compareOfAKind(pO);
- case FULL_HOUSE:
- return compareFullHouse(pO);
- case FLUSH:
- return compareFlush(pO);
- case STRAIGHT:
- return compareStraight(pO);
- case THREE_OF_A_KIND:
- return compareOfAKind(pO);
- case TWO_PAIR:
- //this should work since only the higher pair matters in two pair
- return compareOfAKind(pO);
- case ONE_PAIR:
- return compareOfAKind(pO);
- case HIGH_CARD:
- return compareOfAKind(pO);
- default:
- return 0;
- }
-
- }
- return getHand().compareTo(pO.getHand());
- }
-
- /**
- * Compares one straight against another by just looking at the high card in the straight. However extra care must be taken
- * in order to remove the ace if its an ace low straight for proper results
- * @param pO - the other hand
- * @return an integer between -1 and 1 based on whether this hand was less than equal to or greater than the other hand.
- */
- private int compareStraight(final PokerHand pO){
-
- List<ICard> hand1 = new ArrayList<ICard>(getCards());
- List<ICard> hand2 = new ArrayList<ICard>(pO.getCards());
- Collections.sort(hand1);
- Collections.sort(hand2);
-
- //if either hand is an ace low straight the sorting will actually put ace at the top of the list which would
- //set it way higher then it should be so it needs to be removed
- if (hand1.get(0).getNumber() == ECardNumber.TWO && hand1.get(hand1.size() - 1).getNumber() == ECardNumber.ACE){
- hand1.remove(hand1.size() - 1);
- }
- if (hand2.get(0).getNumber() == ECardNumber.TWO && hand2.get(hand2.size() - 1).getNumber() == ECardNumber.ACE){
- hand2.remove(hand2.size() - 1);
- }
-
- //compare the highest card in the stright of each hand
- return hand1.get(hand1.size() - 1).getNumber().compareTo(hand2.get(hand2.size() - 2).getNumber());
- }
-
- /**
- * Compares one flush against another, Simply just goes down the list of high cards in the flush until it finds
- * one that dosent equal the other.
- * @param pO - the other hand
- * @return an integer between -1 and 1 based on whether this hand was less than equal to or greater than the other hand.
- */
- private int compareFlush(final PokerHand pO){
-
- List<ICard> hand1 = new ArrayList<ICard>(getCards());
- List<ICard> hand2 = new ArrayList<ICard>(pO.getCards());
- Collections.sort(hand1);
- Collections.sort(hand2);
-
- for (int i = hand1.size() - 1; i >= 0; i--){
- if (hand1.get(i).getNumber().compareTo(hand2.get(i).getNumber()) != 0){
- return hand1.get(i).getNumber().compareTo(hand2.get(i).getNumber());
- }
- }
- //if we got this far then that means every single card in the flush was the same...
- return 0;
- }
-
- /**
- * This method should be able to compare any "of a kind" all the way from 4 of a kind down to high card
- * We just assume obviosuly that both hands are the same and each has the same number of kickers however many
- * that may be
- * @param pO - the other hand
- * @return an integer between -1 and 1 based on whether this hand was less than equal to or greater than the other hand.
- */
- private int compareOfAKind(final PokerHand pO){
-
- List<ICard> hand1 = new ArrayList<ICard>(getCards());
- List<ICard> hand2 = new ArrayList<ICard>(pO.getCards());
- Collections.sort(hand1);
- Collections.sort(hand2);
-
- List<ICard> kickers1 = new ArrayList<ICard>(getKickers());
- List<ICard> kickers2 = new ArrayList<ICard>(pO.getKickers());
- Collections.sort(kickers1);
- Collections.sort(kickers2);
-
- //first compare greatest card of the hand
- if (Integer.compare(hand1.get(hand1.size() - 1).getNumber().getNumber(),
- hand2.get(hand2.size() - 1).getNumber().getNumber()) != 0){
- return Integer.compare(hand1.get(hand1.size() - 1).getNumber().getNumber(),
- hand2.get(hand2.size() - 1).getNumber().getNumber());
- }else{
- for (int i = kickers1.size() - 1; i >= 0; i--){
- if (kickers1.get(i).getNumber().compareTo(kickers2.get(i).getNumber()) != 0){
- return kickers1.get(i).getNumber().compareTo(kickers2.get(i).getNumber());
- }
- }
- }
- //the of a kind and all kickers were the same so these hands are equal...
- return 0;
- }
-
- /**
- * For a full house we need to determine which cards are the three of a kind and which are the
- * pair then compare. The pair only comes into play if the trips are equal.
- * @param pO - the other hand
- * @return an integer between -1 and 1 based on whether this hand was less than equal to or greater than the other hand.
- */
- private int compareFullHouse(final PokerHand pO){
-
- Map<ECardNumber, List<ICard>> numbers1 = PokerHandUtility.organizeByNumber(getCards());
- Map<ECardNumber, List<ICard>> numbers2 = PokerHandUtility.organizeByNumber(pO.getCards());
-
- List<ICard> trips1 = new ArrayList<ICard>();
- List<ICard> trips2 = new ArrayList<ICard>();
- List<ICard> pair1 = new ArrayList<ICard>();
- List<ICard> pair2 = new ArrayList<ICard>();
-
- for (ECardNumber number : numbers1.keySet()){
- if (numbers1.get(number).size() == 3){
- trips1 = numbers1.get(number);
- }else if (numbers1.get(number).size() == 2){
- pair1 = numbers1.get(number);
- }
- }
- for (ECardNumber number : numbers2.keySet()){
- if (numbers2.get(number).size() == 3){
- trips2 = numbers2.get(number);
- }else if (numbers2.get(number).size() == 2){
- pair2 = numbers2.get(number);
- }
- }
-
- if (Integer.compare(trips1.get(0).getNumber().getNumber(), trips2.get(0).getNumber().getNumber()) != 0){
- return Integer.compare(trips1.get(0).getNumber().getNumber(), trips2.get(0).getNumber().getNumber());
- }
- if (Integer.compare(pair1.get(0).getNumber().getNumber(), pair2.get(0).getNumber().getNumber()) != 0){
- return Integer.compare(pair1.get(0).getNumber().getNumber(), pair2.get(0).getNumber().getNumber());
- }
- return 0;
- }
-}
View
31 .metadata/.plugins/org.eclipse.core.resources/.history/16/d0029535fc4e00131a0bfd832dc8a3cb
@@ -1,31 +0,0 @@
-package jtj_holdem.game.enums;
-
-public enum ECardNumber {
-
- TWO(2, "two"),
- THREE(3, "three"),
- FOUR(4, "four"),
- FIVE(5, "five"),
- SIX(6, "six"),
- SEVEN(7, "seven"),
- EIGHT(8, "eight"),
- NINE(9, "nine"),
- TEN(10, "ten"),
- JACK(11, "jack"),
- QUEEN(12, "queen"),
- KING(13, "king"),
- ACE(14, "ace");
-
- private final int mNumber;
-
- private final String mName;
-
- private ECardNumber(final int pNumber, final String pName){
- mNumber = pNumber;
- mName = pName
- }
-
- public int getNumber(){
- return mNumber;
- }
-}
View
144 .metadata/.plugins/org.eclipse.core.resources/.history/17/901be433ca5000131a0bfd832dc8a3cb
@@ -1,144 +0,0 @@
-package jtj_holdem.tests;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import jtj_holdem.game.data.Card;
-import jtj_holdem.game.data_structures.CardDeck;
-import jtj_holdem.game.data_structures.PokerHand;
-import jtj_holdem.game.enums.ECardNumber;
-import jtj_holdem.game.enums.ECardSuit;
-import jtj_holdem.game.interfaces.ICard;
-import jtj_holdem.game.utility.PokerHandUtility;
-
-public class CardTests {
-
- public static void main(String[] args) {
-
- /**
- * Need to change this to use JUnit.
- */
- System.out.println("Creating Deck...");
-
- CardDeck deck = new CardDeck();
-
- deck.populateDeck(false);
- System.out.println("Deck before shuffle");
- deck.printDeck();
-
- deck.shuffleDeck();
- System.out.println("###################################");
- System.out.println("Deck after shuffle");
- deck.printDeck();
-
- System.out.println("####################################");
- System.out.println("Deal a Card to me.....");
- System.out.println(deck.dealCard());
- System.out.println("Deal another card......");
- System.out.println(deck.dealCard());
-
- List<ICard> aHand = new ArrayList<ICard>();
- for (int i = 0; i < 7; i++){
-
- ICard card = deck.dealCard();
- System.out.println("dealing card: " + card);
- aHand.add(card);
- }
-
- System.out.println("Checking my hand...");
- PokerHand hand = PokerHandUtility.determineBestHand(aHand);
- System.out.println(hand.getHand());
- System.out.println(hand.getCards());
- System.out.println(hand.getKickers());
-
-// System.out.println("check for flush");
-// PokerHand hand = PokerHandUtility.determineFlush(aHand);
-// System.out.println("hand returned");
-// System.out.println(hand.getHand());
-// System.out.println(hand.getCards());
-//
-// System.out.println("check for straight");
-// hand = PokerHandUtility.determineStraight(aHand);
-// System.out.println("hand returned");
-// System.out.println(hand.getHand());
-// System.out.println(hand.getCards());
-//
-// aHand = new ArrayList<ICard>();
-// aHand.add(new Card(ECardNumber.FOUR, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.SIX, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.FIVE, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.JACK, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.ACE, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.THREE, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.SEVEN, ECardSuit.CLUBS));
-//
-// System.out.println("should be a straight");
-// hand = PokerHandUtility.determineStraight(aHand);
-// System.out.println("hand returned");
-// System.out.println(hand.getHand());
-// System.out.println(hand.getCards());
-//
-// aHand = new ArrayList<ICard>();
-// aHand.add(new Card(ECardNumber.FOUR, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.JACK, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.FIVE, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.TWO, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.ACE, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.THREE, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.SEVEN, ECardSuit.CLUBS));
-//
-// System.out.println("should be a straight ace low");
-// hand = PokerHandUtility.determineStraight(aHand);
-// System.out.println("hand returned");
-// System.out.println(hand.getHand());
-// System.out.println(hand.getCards());
-//
-//
-// aHand = new ArrayList<ICard>();
-// aHand.add(new Card(ECardNumber.FOUR, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.ACE, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.FIVE, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.ACE, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.ACE, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.THREE, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.ACE, ECardSuit.CLUBS));
-//
-// System.out.println("should be a four of a kind");
-// hand = PokerHandUtility.determineFourOfAKind(aHand);
-// System.out.println("hand returned");
-// System.out.println(hand.getHand());
-// System.out.println(hand.getCards());
-// System.out.println(hand.getKickers());
-//
-// aHand = new ArrayList<ICard>();
-// aHand.add(new Card(ECardNumber.FOUR, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.JACK, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.FIVE, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.TWO, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.ACE, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.THREE, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.SEVEN, ECardSuit.CLUBS));
-//
-// System.out.println("should be a straight flush ace low");
-// hand = PokerHandUtility.determineStraightFlush(aHand);
-// System.out.println("hand returned");
-// System.out.println(hand.getHand());
-// System.out.println(hand.getCards());
-//
-// aHand = new ArrayList<ICard>();
-// aHand.add(new Card(ECardNumber.TWO, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.ACE, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.FIVE, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.TWO, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.ACE, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.THREE, ECardSuit.CLUBS));
-// aHand.add(new Card(ECardNumber.ACE, ECardSuit.CLUBS));
-//
-// System.out.println("should be a full house");
-// hand = PokerHandUtility.determineFullHouse(aHand);
-// System.out.println("hand returned");
-// System.out.println(hand.getHand());
-// System.out.println(hand.getCards());
- }
-
-}
View
262 .metadata/.plugins/org.eclipse.core.resources/.history/19/00dbbc9ace5000131a0bfd832dc8a3cb
@@ -1,262 +0,0 @@
-package jtj_holdem.game.data_structures;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import jtj_holdem.game.enums.ECardNumber;
-import jtj_holdem.game.enums.EPokerHand;
-import jtj_holdem.game.interfaces.ICard;
-import jtj_holdem.game.utility.PokerHandUtility;
-
-/**
- * A data structure containing the logical contents of a Poker Hand as well as all of the logic needed
- * in order to compare one hand against another.
- * @author Josh Bass
- *
- */
-public class PokerHand implements Comparable<PokerHand>{
-
- public static final PokerHand INVALID = new PokerHand(EPokerHand.NO_HAND, Collections.<ICard> emptyList(),
- Collections.<ICard> emptyList());
-
- private final EPokerHand mHand;
-
- private final List<ICard> mCards;
-
- private final List<ICard> mKickers;
-
- public PokerHand(final EPokerHand pHand, final List<ICard> pCards, final List<ICard> pKickers){
- mHand = pHand;
- mCards = pCards;
- mKickers = pKickers;
- }
-
- public EPokerHand getHand() {
- return mHand;
- }
-
- public List<ICard> getCards() {
- return mCards;
- }
-
- public List<ICard> getKickers() {
- return mKickers;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((mCards == null) ? 0 : mCards.hashCode());
- result = prime * result + ((mHand == null) ? 0 : mHand.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- PokerHand other = (PokerHand) obj;
- if (mCards == null) {
- if (other.mCards != null)
- return false;
- } else if (!mCards.equals(other.mCards))
- return false;
- if (mHand != other.mHand)
- return false;
- return true;
- }
-
- public boolean isValid(){
- return !this.equals(INVALID);
- }
-
- @Override
- public int compareTo(PokerHand pO) {
-
- if (getHand().compareTo(pO.getHand()) == 0){
- //both hands are the same so we have to get more technical.
-
- switch(mHand){
- case STRAIGHT_FLUSH:
- //straight flush should just follow the same rules as a straight
- return compareStraight(pO);
- case FOUR_OF_A_KIND:
- return compareOfAKind(pO);
- case FULL_HOUSE:
- return compareFullHouse(pO);
- case FLUSH:
- return compareFlush(pO);
- case STRAIGHT:
- return compareStraight(pO);
- case THREE_OF_A_KIND:
- return compareOfAKind(pO);
- case TWO_PAIR:
- //this should work since only the higher pair matters in two pair
- return compareOfAKind(pO);
- case ONE_PAIR:
- return compareOfAKind(pO);
- case HIGH_CARD:
- return compareOfAKind(pO);
- default:
- return 0;
- }
-
- }
- return getHand().compareTo(pO.getHand());
- }
-
- /**
- * Compares one straight against another by just looking at the high card in the straight. However extra care must be taken
- * in order to remove the ace if its an ace low straight for proper results
- * @param pO - the other hand
- * @return an integer between -1 and 1 based on whether this hand was less than equal to or greater than the other hand.
- */
- private int compareStraight(final PokerHand pO){
-
- List<ICard> hand1 = new ArrayList<ICard>(getCards());
- List<ICard> hand2 = new ArrayList<ICard>(pO.getCards());
- Collections.sort(hand1);
- Collections.sort(hand2);
-
- //if either hand is an ace low straight the sorting will actually put ace at the top of the list which would
- //set it way higher then it should be so it needs to be removed
- if (hand1.get(0).getNumber() == ECardNumber.TWO && hand1.get(hand1.size() - 1).getNumber() == ECardNumber.ACE){
- hand1.remove(hand1.size() - 1);
- }
- if (hand2.get(0).getNumber() == ECardNumber.TWO && hand2.get(hand2.size() - 1).getNumber() == ECardNumber.ACE){
- hand2.remove(hand2.size() - 1);
- }
-
- //compare the highest card in the stright of each hand
- return hand1.get(hand1.size() - 1).getNumber().compareTo(hand2.get(hand2.size() - 2).getNumber());
- }
-
- /**
- * Compares one flush against another, Simply just goes down the list of high cards in the flush until it finds
- * one that dosent equal the other.
- * @param pO - the other hand
- * @return an integer between -1 and 1 based on whether this hand was less than equal to or greater than the other hand.
- */
- private int compareFlush(final PokerHand pO){
-
- List<ICard> hand1 = new ArrayList<ICard>(getCards());
- List<ICard> hand2 = new ArrayList<ICard>(pO.getCards());
- Collections.sort(hand1);
- Collections.sort(hand2);
-
- for (int i = hand1.size() - 1; i >= 0; i--){
- if (hand1.get(i).getNumber().compareTo(hand2.get(i).getNumber()) != 0){
- return hand1.get(i).getNumber().compareTo(hand2.get(i).getNumber());
- }
- }
- //if we got this far then that means every single card in the flush was the same...
- return 0;
- }
-
- /**
- * This method should be able to compare any "of a kind" all the way from 4 of a kind down to high card
- * We just assume obviosuly that both hands are the same and each has the same number of kickers however many
- * that may be
- * @param pO - the other hand
- * @return an integer between -1 and 1 based on whether this hand was less than equal to or greater than the other hand.
- */
- private int compareOfAKind(final PokerHand pO){
-
- List<ICard> hand1 = new ArrayList<ICard>(getCards());
- List<ICard> hand2 = new ArrayList<ICard>(pO.getCards());
- Collections.sort(hand1);
- Collections.sort(hand2);
-
- List<ICard> kickers1 = new ArrayList<ICard>(getKickers());
- List<ICard> kickers2 = new ArrayList<ICard>(pO.getKickers());
- Collections.sort(kickers1);
- Collections.sort(kickers2);
-
- //first compare greatest card of the hand
- if (hand1.get(hand1.size() - 1).getNumber().compareTo(hand2.get(hand2.size() - 1).getNumber()) != 0){
- return hand1.get(hand1.size() - 1).getNumber().compareTo(hand2.get(hand2.size() - 1).getNumber());
- }else{
- for (int i = kickers1.size() - 1; i >= 0; i--){
- if (kickers1.get(i).getNumber().compareTo(kickers2.get(i).getNumber()) != 0){
- return kickers1.get(i).getNumber().compareTo(kickers2.get(i).getNumber());
- }
- }
- }
- //the of a kind and all kickers were the same so these hands are equal...
- return 0;
- }
-
-
- private int compareTwoPair(final PokerHand pO){
-
- Map<ECardNumber, List<ICard>> numbers1 = PokerHandUtility.organizeByNumber(getCards());
- Map<ECardNumber, List<ICard>> numbers2 = PokerHandUtility.organizeByNumber(pO.getCards());
-
- List<ICard> highpair1 = new ArrayList<ICard>();
- List<ICard> lowpair1 = new ArrayList<ICard>();
- List<ICard> highpair2 = new ArrayList<ICard>();
- List<ICard> lowpair2 = new ArrayList<ICard>();
-
- for (ECardNumber number : numbers1.keySet()){
- if (numbers1.get(number).size() == 2){
- if (lowPair)
- }
- }
- for (ECardNumber number : numbers2.keySet()){
- if (numbers2.get(number).size() == 3){
- trips2 = numbers2.get(number);
- }else if (numbers2.get(number).size() == 2){
- pair2 = numbers2.get(number);
- }
- }
-
- return 0;
- }
-
- /**
- * For a full house we need to determine which cards are the three of a kind and which are the
- * pair then compare. The pair only comes into play if the trips are equal.
- * @param pO - the other hand
- * @return an integer between -1 and 1 based on whether this hand was less than equal to or greater than the other hand.
- */
- private int compareFullHouse(final PokerHand pO){
-
- Map<ECardNumber, List<ICard>> numbers1 = PokerHandUtility.organizeByNumber(getCards());
- Map<ECardNumber, List<ICard>> numbers2 = PokerHandUtility.organizeByNumber(pO.getCards());
-
- List<ICard> trips1 = new ArrayList<ICard>();
- List<ICard> trips2 = new ArrayList<ICard>();
- List<ICard> pair1 = new ArrayList<ICard>();
- List<ICard> pair2 = new ArrayList<ICard>();
-
- for (ECardNumber number : numbers1.keySet()){
- if (numbers1.get(number).size() == 3){
- trips1 = numbers1.get(number);
- }else if (numbers1.get(number).size() == 2){
- pair1 = numbers1.get(number);
- }
- }
- for (ECardNumber number : numbers2.keySet()){
- if (numbers2.get(number).size() == 3){
- trips2 = numbers2.get(number);
- }else if (numbers2.get(number).size() == 2){
- pair2 = numbers2.get(number);
- }
- }
-
- if (trips1.get(0).getNumber().compareTo(trips2.get(0).getNumber()) != 0){
- return trips1.get(0).getNumber().compareTo(trips2.get(0).getNumber());
- }
- if (pair1.get(0).getNumber().compareTo(pair2.get(0).getNumber()) != 0){
- return pair1.get(0).getNumber().compareTo(pair2.get(0).getNumber());
- }
- return 0;
- }
-}
View
175 .metadata/.plugins/org.eclipse.core.resources/.history/19/4071704ec85000131a0bfd832dc8a3cb
@@ -1,175 +0,0 @@
-package jtj_holdem.game.data_structures;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import jtj_holdem.game.enums.ECardNumber;
-import jtj_holdem.game.enums.EPokerHand;
-import jtj_holdem.game.interfaces.ICard;
-
-public class PokerHand implements Comparable<PokerHand>{
-
- public static final PokerHand INVALID = new PokerHand(EPokerHand.NO_HAND, Collections.<ICard> emptyList(),
- Collections.<ICard> emptyList());
-
- private final EPokerHand mHand;
-
- private final List<ICard> mCards;
-
- private final List<ICard> mKickers;
-
- public PokerHand(final EPokerHand pHand, final List<ICard> pCards, final List<ICard> pKickers){
- mHand = pHand;
- mCards = pCards;
- mKickers = pKickers;
- }
-
- public EPokerHand getHand() {
- return mHand;
- }
-
- public List<ICard> getCards() {
- return mCards;
- }
-
- public List<ICard> getKickers() {
- return mKickers;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((mCards == null) ? 0 : mCards.hashCode());
- result = prime * result + ((mHand == null) ? 0 : mHand.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- PokerHand other = (PokerHand) obj;
- if (mCards == null) {
- if (other.mCards != null)
- return false;
- } else if (!mCards.equals(other.mCards))
- return false;
- if (mHand != other.mHand)
- return false;
- return true;
- }
-
- public boolean isValid(){
- return !this.equals(INVALID);
- }
-
- @Override
- public int compareTo(PokerHand pO) {
-
- if (getHand().compareTo(pO.getHand()) == 0){
- //both hands are the same so we have to get more technical.
-
- switch(mHand){
- case STRAIGHT_FLUSH:
- //straight flush should just follow the same rules as a straight
- return compareStraight(pO);
- case FOUR_OF_A_KIND:
- break;
- case FULL_HOUSE:
- break;
- case FLUSH:
- return compareFlush(pO);
- case STRAIGHT:
- return compareStraight(pO);
- case THREE_OF_A_KIND:
- return compareOfAKind(pO);
- case TWO_PAIR:
- //this should work since only the higher pair matters in two pair
- compareOfAKind(pO);
- case ONE_PAIR:
- return compareOfAKind(pO);
- case HIGH_CARD:
- return compareOfAKind(pO);
- default:
- return 0;
- }
-
- }
- return getHand().compareTo(pO.getHand());
- }
-
- private int compareStraight(final PokerHand pO){
-
- List<ICard> hand1 = new ArrayList<ICard>(getCards());
- List<ICard> hand2 = new ArrayList<ICard>(pO.getCards());
- Collections.sort(hand1);
- Collections.sort(hand2);
-
- //if either hand is an ace low straight the sorting will actually put ace at the top of the list which would
- //set it way higher then it should be so it needs to be removed
- if (hand1.get(0).getNumber() == ECardNumber.TWO && hand1.get(hand1.size() - 1).getNumber() == ECardNumber.ACE){
- hand1.remove(hand1.size() - 1);
- }
- if (hand2.get(0).getNumber() == ECardNumber.TWO && hand2.get(hand2.size() - 1).getNumber() == ECardNumber.ACE){
- hand2.remove(hand2.size() - 1);
- }
-
- //compare the highest card in the stright of each hand
- return hand1.get(hand1.size() - 1).getNumber().compareTo(hand2.get(hand2.size() - 2).getNumber());
- }
-
- private int compareFlush(final PokerHand pO){
-
- List<ICard> hand1 = new ArrayList<ICard>(getCards());
- List<ICard> hand2 = new ArrayList<ICard>(pO.getCards());
- Collections.sort(hand1);
- Collections.sort(hand2);
-
- for (int i = hand1.size() - 1; i >= 0; i--){
- if (hand1.get(i).getNumber().compareTo(hand2.get(i).getNumber()) != 0){
- return hand1.get(i).getNumber().compareTo(hand2.get(i).getNumber());
- }
- }
- //if we got this far then that means every single card in the flush was the same...
- return 0;
- }
-
- /**
- * This method should be able to compare any "of a kind" all the way from 4 of a kind down to high card
- * We just assume obviosuly that both hands are the same and each has the same number of kickers however many
- * that may be
- * @param pO - the other hand
- * @return an integer between -1 and 1 based on whether this hand was less than equal to or greater than the other hand.
- */
- private int compareOfAKind(final PokerHand pO){
-
- List<ICard> hand1 = new ArrayList<ICard>(getCards());
- List<ICard> hand2 = new ArrayList<ICard>(pO.getCards());
- Collections.sort(hand1);
- Collections.sort(hand2);
-
- List<ICard> kickers1 = new ArrayList<ICard>(getKickers());
- List<ICard> kickers2 = new ArrayList<ICard>(pO.getKickers());
- Collections.sort(kickers1);
- Collections.sort(kickers2);
-
- //first compare greatest card of the hand
- if (hand1.get(hand1.size() - 1).getNumber().compareTo(hand2.get(hand2.size() - 1).getNumber()) != 0){
- return hand1.get(hand1.size() - 1).getNumber().compareTo(hand2.get(hand2.size() - 1).getNumber());
- }else{
- for (int i = kickers1.size() - 1; i >= 0; i--){
- if (kickers1.get(i).getNumber().compareTo(kickers2.get(i).getNumber()) != 0){
- return kickers1.get(i).getNumber().compareTo(kickers2.get(i).getNumber());
- }
- }
- }
- //the of a kind and all kickers were the same so these hands are equal...
- return 0;
- }
-}
View
228 .metadata/.plugins/org.eclipse.core.resources/.history/19/5066e320015000131a0bfd832dc8a3cb
@@ -1,228 +0,0 @@
-package jtj_holdem.game.utility;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import jtj_holdem.game.data_structures.PokerHand;
-import jtj_holdem.game.enums.ECardNumber;
-import jtj_holdem.game.enums.ECardSuit;
-import jtj_holdem.game.enums.EPokerHand;
-import jtj_holdem.game.interfaces.ICard;
-
-public class PokerHandUtility {
-
- public static PokerHand determineBestHand(List<ICard> pHand){
-
- PokerHand hand = determineStraightFlush(pHand);
- if (!hand.isValid()){
- hand = determineFourOfAKind(pHand);
- }
- if (!hand.isValid()){
- hand = determineFullHouse(pHand);
- }
- if (!hand.isValid()){
- hand = determineFlush(pHand);
- }
- if (!hand.isValid()){
- hand = determineStraight(pHand);
- }
- if (!hand.isValid()){
- hand = determineThreeOfAKind(pHand);
- }
- if (!hand.isValid()){
- hand = determineTwoPair(pHand);
- }
- if (!hand.isValid()){
- hand = determineOnePair(pHand);
- }
- if (!hand.isValid()){
- List <ICard> cards = new ArrayList<ICard>(pHand);
- Collections.sort(cards);
- hand = new PokerHand(EPokerHand.HIGH_CARD, Collections.singletonList(cards.get(cards.size() - 1)),
- Collections.<ICard>emptyList());
- }
-
- return hand;
- }
-
- public static PokerHand determineStraightFlush(List <ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
-
- PokerHand flushHand = determineFlush(pHand);
- if (flushHand.isValid()){
-
- PokerHand straightFlushHand = determineStraight(flushHand.getCards());
- if (straightFlushHand.isValid()){
- hand = new PokerHand(EPokerHand.STRAIGHT_FLUSH, straightFlushHand.getCards(), Collections.<ICard> emptyList());
- }
- }
- return hand;
- }
-
- public static PokerHand determineFlush(List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
-
- Map<ECardSuit, List<ICard>> suits = new HashMap<ECardSuit, List<ICard>>();
- for (ECardSuit suit : ECardSuit.values()){
- suits.put(suit, new ArrayList<ICard>());
- }
-
- for (ICard card : pHand){
- suits.get(card.getSuit()).add(card);
- }
-
- for (ECardSuit suit : suits.keySet()){
- if (suits.get(suit).size() >= 5){
- Collections.sort(suits.get(suit));
- hand = new PokerHand(EPokerHand.FLUSH, suits.get(suit), Collections.<ICard> emptyList());
- }
- }
- return hand;
- }
-
- public static PokerHand determineStraight(List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
-
- List<ICard> sortedList = new ArrayList<>(pHand);
- Collections.sort(sortedList);
-
- List<ICard> consecutiveCards = new ArrayList<ICard>();
- int lastNumber = 0;
- for (ICard card : sortedList){
- if (lastNumber > 0){
- if (card.getNumber().getNumber() == lastNumber + 1){
- consecutiveCards.add(card);
- }else if (card.getNumber().getNumber() != lastNumber){
- consecutiveCards.clear();
- }
- if (consecutiveCards.size() == 5){
- hand = new PokerHand(EPokerHand.STRAIGHT, consecutiveCards, Collections.<ICard> emptyList());
- break;
- }
- }else{
- //This is the very first card so just add it to our consecutive list
- //as we have nothing to compare it to yet.
- consecutiveCards.add(card);
- if (card.getNumber() == ECardNumber.TWO){
- //since two is our first we need to check for an ace and add it if its there.
- if (sortedList.get(sortedList.size() - 1).getNumber() == ECardNumber.ACE){
- consecutiveCards.add(sortedList.get(sortedList.size() - 1));
- }
- }
- }
- lastNumber = card.getNumber().getNumber();
- }
- return hand;
- }
-
- public static PokerHand determineFourOfAKind(final List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
- Map<ECardNumber, List<ICard>> numbers = organizeByNumber(pHand);
-
- for (ECardNumber number : numbers.keySet()){
- if (numbers.get(number).size() == 4){
- List <ICard> kickers = new ArrayList<ICard>(pHand);
- kickers.removeAll(numbers.get(number));
- hand = new PokerHand(EPokerHand.FOUR_OF_A_KIND, numbers.get(number), kickers);
- break;
- }
- }
- return hand;
- }
-
- public static PokerHand determineFullHouse(final List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
- Map<ECardNumber, List<ICard>> numbers = organizeByNumber(pHand);
-
- List <ICard> threeOfAKind = Collections.emptyList();
- List <ICard> pair = Collections.emptyList();
- for (ECardNumber number : numbers.keySet()){
- if (numbers.get(number).size() == 3){
- threeOfAKind = numbers.get(number);
- }else if (numbers.get(number).size() == 2){
- pair = numbers.get(number);
- }
- }
- if (!threeOfAKind.isEmpty() && !pair.isEmpty()){
- List <ICard> fullHouse = new ArrayList<ICard>(threeOfAKind);
- fullHouse.addAll(pair);
- hand = new PokerHand(EPokerHand.FULL_HOUSE, fullHouse, Collections.<ICard> emptyList());
- }
- return hand;
- }
-
- public static PokerHand determineThreeOfAKind(final List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
- Map<ECardNumber, List<ICard>> numbers = organizeByNumber(pHand);
-
- for (ECardNumber number : numbers.keySet()){
- if (numbers.get(number).size() == 3){
- List <ICard> kickers = new ArrayList<ICard>(pHand);
- kickers.removeAll(numbers.get(number));
- hand = new PokerHand(EPokerHand.THREE_OF_A_KIND, numbers.get(number), kickers);
- }
- }
- return hand;
- }
-
- public static PokerHand determineTwoPair(final List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
- Map<ECardNumber, List<ICard>> numbers = organizeByNumber(pHand);
-
- List <ICard> pair1 = Collections.emptyList();
- List <ICard> pair2 = Collections.emptyList();
- for (ECardNumber number : numbers.keySet()){
- if (numbers.get(number).size() == 2){
- if (pair1.isEmpty()){
- pair1 = numbers.get(number);
- }else if (!pair1.isEmpty() && pair2.isEmpty()){
- pair2 = numbers.get(number);
- }
- }
- }
- if (!pair1.isEmpty() && !pair2.isEmpty()){
- List <ICard> pairs = new ArrayList<ICard>(pair1);
- pairs.addAll(pair2);
- List <ICard> kickers = new ArrayList<ICard>(pHand);
- kickers.removeAll(pairs);
- hand = new PokerHand(EPokerHand.TWO_PAIR, pairs, kickers);
- }
- return hand;
- }
-
- public static PokerHand determineOnePair(final List <ICard> pHand){
- PokerHand hand = PokerHand.INVALID;
- Map<ECardNumber, List<ICard>> numbers = organizeByNumber(pHand);
-
- for (ECardNumber number : numbers.keySet()){
- if (numbers.get(number).size() == 2){
- List <ICard> kickers = new ArrayList<ICard>(pHand);
- kickers.removeAll(numbers.get(number));
- hand = new PokerHand(EPokerHand.ONE_PAIR, numbers.get(number), kickers);
- }
- }
- return hand;
- }
-
- private static Map<ECardNumber, List<ICard>> organizeByNumber(final List<ICard> pHand){
-
- Map<ECardNumber, List<ICard>> numbers = new HashMap<ECardNumber, List<ICard>>();
- for (ECardNumber number : ECardNumber.values()){
- numbers.put(number, new ArrayList<ICard>());
- }
- for (ICard card : pHand){
- numbers.get(card.getNumber()).add(card);
- }
- return numbers;
- }
-}
View
58 .metadata/.plugins/org.eclipse.core.resources/.history/1a/10bf3c9dd14f00131a0bfd832dc8a3cb
@@ -1,58 +0,0 @@
-package jtj_holdem.tests;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import jtj_holdem.game.data_structures.CardDeck;
-import jtj_holdem.game.data_structures.PokerHand;
-import jtj_holdem.game.interfaces.ICard;
-import jtj_holdem.game.utility.PokerHandUtility;
-
-public class CardTests {
-
- public static void main(String[] args) {
-
- /**
- * Need to change this to use JUnit.
- */
- System.out.println("Creating Deck...");
-
- CardDeck deck = new CardDeck();
-
- deck.populateDeck(false);
- System.out.println("Deck before shuffle");
- deck.printDeck();
-
- deck.shuffleDeck();
- System.out.println("###################################");
- System.out.println("Deck after shuffle");
- deck.printDeck();
-
- System.out.println("####################################");
- System.out.println("Deal a Card to me.....");
- System.out.println(deck.dealCard());
- System.out.println("Deal another card......");
- System.out.println(deck.dealCard());
-
- List<ICard> aHand = new ArrayList<ICard>();
- for (int i = 0; i < 7; i++){
-
- ICard card = deck.dealCard();
- System.out.println("dealing card: " + card);
- aHand.add(card);
- }
-
- System.out.println("check for flush");
- PokerHand hand = PokerHandUtility.determineFlush(aHand);
- System.out.println("hand returned");
- System.out.println(hand.getHand());
- System.out.println(hand.getCards());
-
- System.out.println("check for straight");
- hand = PokerHandUtility.determineStraight(aHand);
- System.out.println("hand returned");
- System.out.println(hand.getHand());
- System.out.println(hand.getCards());
- }
-
-}
View
29 .metadata/.plugins/org.eclipse.core.resources/.history/1c/f0161fd8ff4e00131a0bfd832dc8a3cb
@@ -1,29 +0,0 @@
-package jtj_holdem.game.main;
-
-import jtj_holdem.game.data_structures.CardDeck;
-
-public class MainGame {
-
- public static void main(String[] args) {
-
- System.out.println("Hello");
- System.out.println("Creating Deck...");
-
- CardDeck deck = new CardDeck();
-
- deck.populateDeck(false);
- System.out.println("Deck before shuffle");
- deck.printDeck();
-
- deck.shuffleDeck();
- System.out.println("###################################");
- System.out.println("Deck after shuffle");
- deck.printDeck();
-
- System.out.println("####################################");
- System.out.println("Deal a Card to me.....");
- System.out.println(deck.dealCard());
- System.out.println("Deal another card......");
- System.out.println(deck.dealCard());
- }
-}
View
14 .metadata/.plugins/org.eclipse.core.resources/.history/1d/500edc9cca5000131a0bfd832dc8a3cb
@@ -1,14 +0,0 @@
-package jtj_holdem.tests;
-
-public class GeneralTest {
-
- public static void main(String[] args) {
- // TODO Auto-generated method stub
-
- System.out.println("General compare test");
- int a = 5;
- int b = 5;
- System.out.println(Integer.valueOf(a).compareTo(b));
- }
-
-}
View
123 .metadata/.plugins/org.eclipse.core.resources/.history/1d/60732154ff4f00131a0bfd832dc8a3cb
@@ -1,123 +0,0 @@
-package jtj_holdem.tests;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import jtj_holdem.game.data.Card;
-import jtj_holdem.game.data_structures.CardDeck;
-import jtj_holdem.game.data_structures.PokerHand;
-import jtj_holdem.game.enums.ECardNumber;
-import jtj_holdem.game.enums.ECardSuit;
-import jtj_holdem.game.interfaces.ICard;
-import jtj_holdem.game.utility.PokerHandUtility;
-
-public class CardTests {
-
- public static void main(String[] args) {
-
- /**
- * Need to change this to use JUnit.
- */
- System.out.println("Creating Deck...");
-
- CardDeck deck = new CardDeck();
-
- deck.populateDeck(false);
- System.out.println("Deck before shuffle");
- deck.printDeck();
-
- deck.shuffleDeck();
- System.out.println("###################################");
- System.out.println("Deck after shuffle");
- deck.printDeck();
-
- System.out.println("####################################");
- System.out.println("Deal a Card to me.....");
- System.out.println(deck.dealCard());
- System.out.println("Deal another card......");
- System.out.println(deck.dealCard());
-
- List<ICard> aHand = new ArrayList<ICard>();
- for (int i = 0; i < 7; i++){
-
- ICard card = deck.dealCard();
- System.out.println("dealing card: " + card);
- aHand.add(card);
- }
-
- System.out.println("check for flush");
- PokerHand hand = PokerHandUtility.determineFlush(aHand);
- System.out.println("hand returned");
- System.out.println(hand.getHand());
- System.out.println(hand.getCards());
-
- System.out.println("check for straight");
- hand = PokerHandUtility.determineStraight(aHand);
- System.out.println("hand returned");
- System.out.println(hand.getHand());
- System.out.println(hand.getCards());
-
- aHand = new ArrayList<ICard>();
- aHand.add(new Card(ECardNumber.FOUR, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.SIX, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.FIVE, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.JACK, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.ACE, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.THREE, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.SEVEN, ECardSuit.CLUBS));
-
- System.out.println("should be a straight");
- hand = PokerHandUtility.determineStraight(aHand);
- System.out.println("hand returned");
- System.out.println(hand.getHand());
- System.out.println(hand.getCards());
-
- aHand = new ArrayList<ICard>();
- aHand.add(new Card(ECardNumber.FOUR, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.JACK, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.FIVE, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.TWO, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.ACE, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.THREE, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.SEVEN, ECardSuit.CLUBS));
-
- System.out.println("should be a straight ace low");
- hand = PokerHandUtility.determineStraight(aHand);
- System.out.println("hand returned");
- System.out.println(hand.getHand());
- System.out.println(hand.getCards());
-
-
- aHand = new ArrayList<ICard>();
- aHand.add(new Card(ECardNumber.FOUR, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.ACE, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.FIVE, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.ACE, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.ACE, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.THREE, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.ACE, ECardSuit.CLUBS));
-
- System.out.println("should be a four of a kind");
- hand = PokerHandUtility.determineFourOfAKind(aHand);
- System.out.println("hand returned");
- System.out.println(hand.getHand());
- System.out.println(hand.getCards());
- System.out.println(hand.getKickers());
-
- aHand = new ArrayList<ICard>();
- aHand.add(new Card(ECardNumber.FOUR, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.JACK, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.FIVE, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.TWO, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.ACE, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.THREE, ECardSuit.CLUBS));
- aHand.add(new Card(ECardNumber.SEVEN, ECardSuit.CLUBS));
-
- System.out.println("should be a straight flush ace low");
- hand = PokerHandUtility.determineStraightFlush(aHand);
- System.out.println("hand returned");
- System.out.println(hand.getHand());
- System.out.println(hand.getCards());
- }
-
-}
View
6 .metadata/.plugins/org.eclipse.core.resources/.history/1e/50e50a46035000131a0bfd832dc8a3cb
@@ -1,6 +0,0 @@
-JTJ_Holdem
-==========
-
-### Getting Started... ###
-
-Download Git: http://git-scm.com/downloads
View
185 .metadata/.plugins/org.eclipse.core.resources/.history/1f/908d5c91c85000131a0bfd832dc8a3cb
@@ -1,185 +0,0 @@
-package jtj_holdem.game.data_structures;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import jtj_holdem.game.enums.ECardNumber;
-import jtj_holdem.game.enums.EPokerHand;
-import jtj_holdem.game.interfaces.ICard;
-import jtj_holdem.game.utility.PokerHandUtility;
-
-public class PokerHand implements Comparable<PokerHand>{
-
- public static final PokerHand INVALID = new PokerHand(EPokerHand.NO_HAND, Collections.<ICard> emptyList(),
- Collections.<ICard> emptyList());
-
- private final EPokerHand mHand;
-
- private final List<ICard> mCards;
-
- private final List<ICard> mKickers;
-
- public PokerHand(final EPokerHand pHand, final List<ICard> pCards, final List<ICard> pKickers){
- mHand = pHand;
- mCards = pCards;
- mKickers = pKickers;
- }
-
- public EPokerHand getHand() {
- return mHand;
- }
-
- public List<ICard> getCards() {
- return mCards;
- }
-
- public List<ICard> getKickers() {
- return mKickers;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((mCards == null) ? 0 : mCards.hashCode());
- result = prime * result + ((mHand == null) ? 0 : mHand.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- PokerHand other = (PokerHand) obj;
- if (mCards == null) {
- if (other.mCards != null)
- return false;
- } else if (!mCards.equals(other.mCards))
- return false;
- if (mHand != other.mHand)
- return false;
- return true;
- }
-
- public boolean isValid(){
- return !this.equals(INVALID);
- }
-
- @Override
- public int compareTo(PokerHand pO) {
-
- if (getHand().compareTo(pO.getHand()) == 0){
- //both hands are the same so we have to get more technical.
-
- switch(mHand){
- case STRAIGHT_FLUSH:
- //straight flush should just follow the same rules as a straight
- return compareStraight(pO);
- case FOUR_OF_A_KIND:
- compareOfAKind(pO);
- case FULL_HOUSE:
- break;
- case FLUSH:
- return compareFlush(pO);
- case STRAIGHT:
- return compareStraight(pO);
- case THREE_OF_A_KIND:
- return compareOfAKind(pO);
- case TWO_PAIR:
- //this should work since only the higher pair matters in two pair
- compareOfAKind(pO);
- case ONE_PAIR:
- return compareOfAKind(pO);
- case HIGH_CARD:
- return compareOfAKind(pO);
- default:
- return 0;
- }
-
- }
- return getHand().compareTo(pO.getHand());
- }
-
- private int compareStraight(final PokerHand pO){
-
- List<ICard> hand1 = new ArrayList<ICard>(getCards());
- List<ICard> hand2 = new ArrayList<ICard>(pO.getCards());
- Collections.sort(hand1);
- Collections.sort(hand2);
-
- //if either hand is an ace low straight the sorting will actually put ace at the top of the list which would
- //set it way higher then it should be so it needs to be removed
- if (hand1.get(0).getNumber() == ECardNumber.TWO && hand1.get(hand1.size() - 1).getNumber() == ECardNumber.ACE){
- hand1.remove(hand1.size() - 1);
- }
- if (hand2.get(0).getNumber() == ECardNumber.TWO && hand2.get(hand2.size() - 1).getNumber() == ECardNumber.ACE){
- hand2.remove(hand2.size() - 1);
- }
-
- //compare the highest card in the stright of each hand
- return hand1.get(hand1.size() - 1).getNumber().compareTo(hand2.get(hand2.size() - 2).getNumber());
- }
-
- private int compareFlush(final PokerHand pO){
-
- List<ICard> hand1 = new ArrayList<ICard>(getCards());
- List<ICard> hand2 = new ArrayList<ICard>(pO.getCards());
- Collections.sort(hand1);
- Collections.sort(hand2);
-
- for (int i = hand1.size() - 1; i >= 0; i--){
- if (hand1.get(i).getNumber().compareTo(hand2.get(i).getNumber()) != 0){
- return hand1.get(i).getNumber().compareTo(hand2.get(i).getNumber());
- }
- }
- //if we got this far then that means every single card in the flush was the same...
- return 0;
- }
-
- /**
- * This method should be able to compare any "of a kind" all the way from 4 of a kind down to high card
- * We just assume obviosuly that both hands are the same and each has the same number of kickers however many
- * that may be
- * @param pO - the other hand
- * @return an integer between -1 and 1 based on whether this hand was less than equal to or greater than the other hand.
- */
- private int compareOfAKind(final PokerHand pO){
-
- List<ICard> hand1 = new ArrayList<ICard>(getCards());
- List<ICard> hand2 = new ArrayList<ICard>(pO.getCards());
- Collections.sort(hand1);
- Collections.sort(hand2);
-
- List<ICard> kickers1 = new ArrayList<ICard>(getKickers());
- List<ICard> kickers2 = new ArrayList<ICard>(pO.getKickers());
- Collections.sort(kickers1);
- Collections.sort(kickers2);
-
- //first compare greatest card of the hand
- if (hand1.get(hand1.size() - 1).getNumber().compareTo(hand2.get(hand2.size() - 1).getNumber()) != 0){
- return hand1.get(hand1.size() - 1).getNumber().compareTo(hand2.get(hand2.size() - 1).getNumber());
- }else{
- for (int i = kickers1.size() - 1; i >= 0; i--){
- if (kickers1.get(i).getNumber().compareTo(kickers2.get(i).getNumber()) != 0){
- return kickers1.get(i).getNumber().compareTo(kickers2.get(i).getNumber());
- }
- }
- }
- //the of a kind and all kickers were the same so these hands are equal...
- return 0;
- }
-
- private int compareFullHouse(final PokerHand pO){
-
- Map<ECardNumber, List<ICard>> numbers1 = PokerHandUtility.organizeByNumber(getHand());
- Map<ECardNumber, List<ICard>> numbers1 = PokerHandUtility.organizeByNumber(getHand());
-
- return 0;
- }
-}
View
45 .metadata/.plugins/org.eclipse.core.resources/.history/22/4057cca7155400131a0bfd832dc8a3cb
@@ -1,45 +0,0 @@
-package jtj_holdem.game.graphics2d.test;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import org.newdawn.slick.AppGameContainer;
-import org.newdawn.slick.BasicGame;
-import org.newdawn.slick.GameContainer;
-import org.newdawn.slick.Graphics;
-import org.newdawn.slick.SlickException;
-
-public class SlickTest extends BasicGame
-{
- public SlickTest(String gamename)
- {
- super(gamename);
- }
-
- @Override
- public void init(GameContainer gc) throws SlickException {}
-
- @Override
- public void update(GameContainer gc, int i) throws SlickException {}
-
- @Override
- public void render(GameContainer gc, Graphics g) throws SlickException
- {
- g.drawString("Howdy!", 10, 200);
-
-
- }
-
- public static void main(String[] args)
- {
- try
- {
- AppGameContainer appgc;
- appgc = new AppGameContainer(new SlickTest("Simple Slick Game"));
- appgc.setDisplayMode(640, 480, false);
- appgc.start();
- }
- catch (SlickException ex)
- {
- Logger.getLogger(SlickTest.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
-}
View
0 .metadata/.plugins/org.eclipse.core.resources/.history/22/b04a2335fb4e00131a0bfd832dc8a3cb
No changes.
View
203 .metadata/.plugins/org.eclipse.core.resources/.history/24/00b4ecdafe4f00131a0bfd832dc8a3cb
@@ -1,203 +0,0 @@
-package jtj_holdem.game.utility;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import jtj_holdem.game.data_structures.PokerHand;
-import jtj_holdem.game.enums.ECardNumber;
-import jtj_holdem.game.enums.ECardSuit;
-import jtj_holdem.game.enums.EPokerHand;
-import jtj_holdem.game.interfaces.ICard;
-
-public class PokerHandUtility {
-
- public static EPokerHand determineBestHand(List<ICard> pHand){
-
- return null;
- }
-
- public static PokerHand determineStraightFlush(List <ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
-
- PokerHand flushHand = determineFlush(pHand);
- if (flushHand.isValid()){
-
- PokerHand straightFlushHand = determineStraight(flushHand.getCards());
- if (straightFlushHand.isValid()){
- hand = new PokerHand(EPokerHand.STRAIGHT_FLUSH, straightFlushHand.getCards(), Collections.<ICard> emptyList());
- }
- }
- return hand;
- }
-
- public static PokerHand determineFlush(List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
-
- Map<ECardSuit, List<ICard>> suits = new HashMap<ECardSuit, List<ICard>>();
- for (ECardSuit suit : ECardSuit.values()){
- suits.put(suit, new ArrayList<ICard>());
- }
-
- for (ICard card : pHand){
- suits.get(card.getSuit()).add(card);
- }
-
- for (ECardSuit suit : suits.keySet()){
- if (suits.get(suit).size() >= 5){
- Collections.sort(suits.get(suit));
- hand = new PokerHand(EPokerHand.FLUSH, suits.get(suit), Collections.<ICard> emptyList());
- }
- }
- return hand;
- }
-
- public static PokerHand determineStraight(List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
-
- List<ICard> sortedList = new ArrayList<>(pHand);
- Collections.sort(sortedList);
-
- List<ICard> consecutiveCards = new ArrayList<ICard>();
- int lastNumber = 0;
- for (ICard card : sortedList){
- if (lastNumber > 0){
- if (card.getNumber().getNumber() == lastNumber + 1){
- consecutiveCards.add(card);
- }else if (card.getNumber().getNumber() != lastNumber){
- consecutiveCards.clear();
- }
- if (consecutiveCards.size() == 5){
- hand = new PokerHand(EPokerHand.STRAIGHT, consecutiveCards, Collections.<ICard> emptyList());
- break;
- }
- }else{
- //This is the very first card so just add it to our consecutive list
- //as we have nothing to compare it to yet.
- consecutiveCards.add(card);
- if (card.getNumber() == ECardNumber.TWO){
- //since two is our first we need to check for an ace and add it if its there.
- if (sortedList.get(sortedList.size() - 1).getNumber() == ECardNumber.ACE){
- consecutiveCards.add(sortedList.get(sortedList.size() - 1));
- }
- }
- }
- lastNumber = card.getNumber().getNumber();
- }
- return hand;
- }
-
- public static PokerHand determineFourOfAKind(final List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
- Map<ECardNumber, List<ICard>> numbers = organizeByNumber(pHand);
-
- for (ECardNumber number : numbers.keySet()){
- if (numbers.get(number).size() == 4){
- List <ICard> kickers = new ArrayList<ICard>(pHand);
- kickers.removeAll(numbers.get(number));
- hand = new PokerHand(EPokerHand.FOUR_OF_A_KIND, numbers.get(number), kickers);
- break;
- }
- }
- return hand;
- }
-
- public static PokerHand determineFullHouse(final List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
- Map<ECardNumber, List<ICard>> numbers = organizeByNumber(pHand);
-
- List <ICard> pair1 = Collections.emptyList();
- List <ICard> pair2 = Collections.emptyList();
- for (ECardNumber number : numbers.keySet()){
- if (numbers.get(number).size() == 2){
- if (pair1.isEmpty()){
- pair1 = numbers.get(number);
- }else if (!pair1.isEmpty() && pair2.isEmpty()){
- pair2 = numbers.get(number);
- }
- }
- }
- if (!pair1.isEmpty() && !pair2.isEmpty()){
- List <ICard> pairs = new ArrayList<ICard>(pair1);
- pairs.addAll(pair2);
- List <ICard> kickers = new ArrayList<ICard>(pHand);
- kickers.removeAll(numbers.get(pairs));
- hand = new PokerHand(EPokerHand.TWO_PAIR, pairs, kickers);
- }
- return hand;
- }
-
- public static PokerHand determineThreeOfAKind(final List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
- Map<ECardNumber, List<ICard>> numbers = organizeByNumber(pHand);
-
- for (ECardNumber number : numbers.keySet()){
- if (numbers.get(number).size() == 3){
- List <ICard> kickers = new ArrayList<ICard>(pHand);
- kickers.removeAll(numbers.get(number));
- hand = new PokerHand(EPokerHand.THREE_OF_A_KIND, numbers.get(number), kickers);
- }
- }
- return hand;
- }
-
- public static PokerHand determineTwoPair(final List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
- Map<ECardNumber, List<ICard>> numbers = organizeByNumber(pHand);
-
- List <ICard> pair1 = Collections.emptyList();
- List <ICard> pair2 = Collections.emptyList();
- for (ECardNumber number : numbers.keySet()){
- if (numbers.get(number).size() == 2){
- if (pair1.isEmpty()){
- pair1 = numbers.get(number);
- }else if (!pair1.isEmpty() && pair2.isEmpty()){
- pair2 = numbers.get(number);
- }
- }
- }
- if (!pair1.isEmpty() && !pair2.isEmpty()){
- List <ICard> pairs = new ArrayList<ICard>(pair1);
- pairs.addAll(pair2);
- List <ICard> kickers = new ArrayList<ICard>(pHand);
- kickers.removeAll(numbers.get(pairs));
- hand = new PokerHand(EPokerHand.TWO_PAIR, pairs, kickers);
- }
- return hand;
- }
-
- public static PokerHand determineOnePair(final List <ICard> pHand){
- PokerHand hand = PokerHand.INVALID;
- Map<ECardNumber, List<ICard>> numbers = organizeByNumber(pHand);
-
- for (ECardNumber number : numbers.keySet()){
- if (numbers.get(number).size() == 2){
- List <ICard> kickers = new ArrayList<ICard>(pHand);
- kickers.removeAll(numbers.get(number));
- hand = new PokerHand(EPokerHand.ONE_PAIR, numbers.get(number), kickers);
- }
- }
- return hand;
- }
-
- private static Map<ECardNumber, List<ICard>> organizeByNumber(final List<ICard> pHand){
-
- Map<ECardNumber, List<ICard>> numbers = new HashMap<ECardNumber, List<ICard>>();
- for (ECardNumber number : ECardNumber.values()){
- numbers.put(number, new ArrayList<ICard>());
- }
- for (ICard card : pHand){
- numbers.get(card.getNumber()).add(card);
- }
- return numbers;
- }
-}
View
159 .metadata/.plugins/org.eclipse.core.resources/.history/24/b0fb253df84f00131a0bfd832dc8a3cb
@@ -1,159 +0,0 @@
-package jtj_holdem.game.utility;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import jtj_holdem.game.data_structures.PokerHand;
-import jtj_holdem.game.enums.ECardNumber;
-import jtj_holdem.game.enums.ECardSuit;
-import jtj_holdem.game.enums.EPokerHand;
-import jtj_holdem.game.interfaces.ICard;
-
-public class PokerHandUtility {
-
- public static EPokerHand determineBestHand(List<ICard> pHand){
-
- return null;
- }
-
- public static PokerHand determineFlush(List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
-
- Map<ECardSuit, List<ICard>> suits = new HashMap<ECardSuit, List<ICard>>();
- for (ECardSuit suit : ECardSuit.values()){
- suits.put(suit, new ArrayList<ICard>());
- }
-
- for (ICard card : pHand){
- suits.get(card.getSuit()).add(card);
- }
-
- for (ECardSuit suit : suits.keySet()){
- if (suits.get(suit).size() >= 5){
- hand = new PokerHand(EPokerHand.FLUSH, suits.get(suit), Collections.<ICard> emptyList());
- }
- }
- return hand;
- }
-
- public static PokerHand determineStraight(List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
-
- List<ICard> sortedList = new ArrayList<>(pHand);
- Collections.sort(sortedList);
-
- List<ICard> consecutiveCards = new ArrayList<ICard>();
- int lastNumber = 0;
- for (ICard card : sortedList){
- if (lastNumber > 0){
- if (card.getNumber().getNumber() == lastNumber + 1){
- consecutiveCards.add(card);
- }else if (card.getNumber().getNumber() != lastNumber){
- consecutiveCards.clear();
- }
- if (consecutiveCards.size() == 5){
- hand = new PokerHand(EPokerHand.STRAIGHT, consecutiveCards, Collections.<ICard> emptyList());
- break;
- }
- }else{
- //This is the very first card so just add it to our consecutive list
- //as we have nothing to compare it to yet.
- consecutiveCards.add(card);
- if (card.getNumber() == ECardNumber.TWO){
- //since two is our first we need to check for an ace and add it if its there.
- if (sortedList.get(sortedList.size() - 1).getNumber() == ECardNumber.ACE){
- consecutiveCards.add(sortedList.get(sortedList.size() - 1));
- }
- }
- }
- lastNumber = card.getNumber().getNumber();
- }
-
- return hand;
- }
-
- public static PokerHand determineFourOfAKind(final List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
- Map<ECardNumber, List<ICard>> numbers = organizeByNumber(pHand);
-
- for (ECardNumber number : numbers.keySet()){
- if (numbers.get(number).size() == 4){
- List <ICard> kickers = new ArrayList<ICard>(pHand);
- kickers.removeAll(numbers.get(number));
- hand = new PokerHand(EPokerHand.FOUR_OF_A_KIND, numbers.get(number), kickers);
- break;
- }
- }
-
- return hand;
- }
-
- public static PokerHand determineThreeOfAKind(final List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
- Map<ECardNumber, List<ICard>> numbers = organizeByNumber(pHand);
-
- for (ECardNumber number : numbers.keySet()){
- if (numbers.get(number).size() == 3){
- List <ICard> kickers = new ArrayList<ICard>(pHand);
- kickers.removeAll(numbers.get(number));
- hand = new PokerHand(EPokerHand.THREE_OF_A_KIND, numbers.get(number), kickers);
- break;
- }
- }
-
- return hand;
- }
-
- public static PokerHand determineTwoPair(final List<ICard> pHand){
-
- PokerHand hand = PokerHand.INVALID;
- Map<ECardNumber, List<ICard>> numbers = organizeByNumber(pHand);
-
- List <ICard> pair1 = Collections.emptyList();
- List <ICard> pair2 = Collections.emptyList();
- for (ECardNumber number : numbers.keySet()){
- if (numbers.get(number).size() == 2){
- if (pair1.isEmpty()){
- pair1 = numbers.get(number);
- }else if (!pair1.isEmpty() && pair2.isEmpty()){
- pair2 = numbers.get(number);
- }
- }
- }
- if (!pair1.isEmpty() && !pair2.isEmpty()){
- List <ICard> pairs = new ArrayList<ICard>(pair1);
- pairs.addAll(pair2);
- List <ICard> kickers = new ArrayList<ICard>(pHand);
- kickers.removeAll(numbers.get(pairs));
- hand = new PokerHand(EPokerHand.TWO_PAIR, pairs, kickers);
- }
-
- return hand;
- }
-
- public static determineOnePair(final List <ICard> pHand){
- PokerHand hand = PokerHand.INVALID;
- Map<ECardNumber, List<ICard>> numbers = organizeByNumber(pHand);
-
- return hand;
- }
-
- private static Map<ECardNumber, List<ICard>> organizeByNumber(final List<ICard> pHand){
-
- Map<ECardNumber, List<ICard>> numbers = new HashMap<ECardNumber, List<ICard>>();
- for (ECardNumber number : ECardNumber.values()){
- numbers.put(number, new ArrayList<ICard>());
- }
- for (ICard card : pHand){
- numbers.get(card.getNumber()).add(card);
- }
- return numbers;
- }
-}
View
57 .metadata/.plugins/org.eclipse.core.resources/.history/26/80ba0087225400131a0bfd832dc8a3cb
@@ -1,57 +0,0 @@
-package jtj_holdem.game.graphics2d.test;
-import java.awt.Image;
-import java.io.File;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.newdawn.slick.AppGameContainer;
-import org.newdawn.slick.BasicGame;
-import org.newdawn.slick.GameContainer;
-import org.newdawn.slick.Graphics;
-import org.newdawn.slick.SlickException;
-
-public class SlickTest extends BasicGame