Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ctgao authored Jul 20, 2023
2 parents 5e062cc + b863975 commit a8b1576
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 5 deletions.
24 changes: 20 additions & 4 deletions src/main/java/com/github/zipcodewilmington/casino/CardPlayer.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.github.zipcodewilmington.casino;

import com.github.zipcodewilmington.casino.cardutils.HandOfCards;
import com.github.zipcodewilmington.casino.cardutils.PlayingCard;
import com.github.zipcodewilmington.casino.cardutils.PlayingCardValue;
import com.github.zipcodewilmington.casino.cardutils.*;
import com.github.zipcodewilmington.utils.IOConsole;

import java.util.Scanner;
Expand Down Expand Up @@ -31,6 +29,7 @@ public void useCard(PlayingCard pc){

public void printHand(){
// not sure what to put here yet so i'll leave it empty for now
super.printToConsole(curHand.toString());
}

public void clearHand(){
Expand All @@ -42,7 +41,24 @@ public PlayingCard promptForCard(String prompt){
String[] cardPieces = response.toUpperCase().split(" ");

PlayingCardValue pcv = parseCardValue(cardPieces);
PlayingCardSuit pcs = parseCardSuit(cardPieces);

if(pcv == null || pcs == null){
// or some exception??? dunno yet
return null;
}
return new PlayingCard(pcs, pcv);
}

private PlayingCardSuit parseCardSuit(String[] cardPieces) {
for(String s : cardPieces){
// iterating through the stuff split into spaces
for(PlayingCardSuit suit : PlayingCardSuit.values()){
if(s.equals(suit.name())){
return suit;
}
}
}
return null;
}

Expand All @@ -51,7 +67,7 @@ private PlayingCardValue parseCardValue(String[] cardPieces) {
// iterating through the stuff split into spaces
for(PlayingCardValue value : PlayingCardValue.values()){
if(s.equals(value.toString())){

return value;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,7 @@ public Integer promptPlayerFoMoney(String money) {
return playerWantToSpend;
}


public void printToConsole(String prompt) {
playerInput.println(prompt);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.github.zipcodewilmington.casino;

public class RouletteGame implements GameInterface{

private double payOutMult;
private RouletteTable table;
private PlayerInterface roulettePlayer;
private int ballCurrentNum;


public boolean winBet(String betParam) {return true;}

public void endGame(){};

@Override
public void add(PlayerInterface player) {

}

@Override
public void remove(PlayerInterface player) {

}

@Override
public void run() {

}

@Override
public void printWinner() {

}

@Override
public boolean isEndCondition() {
return false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package com.github.zipcodewilmington.casino;

import java.util.HashMap;
import java.util.Map;

public enum RouletteNumParam {
one(1, 1, 2, 2, 1, 1),
two(2, 2, 1, 1, 1, 2),
three(3, 1, 2, 1, 1, 3),
four(4, 2, 1, 1, 1, 1),
five(5, 1, 2, 1, 1,2),
six(6, 2, 1, 1, 1, 3),
seven(7, 1, 2, 1, 1, 1),
eight(8, 2, 1, 1, 1, 2),
nine(9, 1, 2, 1, 1, 3),
ten(10, 2, 1, 1, 1, 1),
eleven(11, 1, 1, 1, 1, 2),
twelve(12, 2, 2, 1, 1, 3),
thirteen(13, 1, 1, 1, 2, 1),
fourteen(14, 2, 2, 1, 2, 2),
fifteen(15, 1, 1, 1, 2, 3),
sixteen(16, 2, 2, 1, 2, 1),
seventeen(17, 1, 1, 1, 2, 2),
eighteen(18, 2, 2, 1, 2, 3),
nineteen(19, 1, 2, 2, 2, 1),
twenty(20, 2, 1, 2, 2, 2),
twenty_one(21, 1, 2, 2, 2, 3),
twenty_two(22, 2, 1, 2, 2, 1),
twenty_three(23, 1, 2, 2, 2, 2),
twenty_four(24, 2, 1, 2, 2, 3),
twenty_five(25, 1, 2, 2, 3, 1),
twenty_six(26, 2, 1, 2, 3, 2),
twenty_seven(27, 1, 2, 2, 3, 3),
twenty_eight(28, 2, 1, 2, 3, 1),
twenty_nine(29, 1, 1, 2, 3, 2),
thirty(30, 2, 2, 2, 3, 3),
thirty_one(31, 1, 1, 2, 3, 1),
thirty_two(32, 2, 2, 2, 3, 2),
thirty_three(33, 1, 1, 2, 3, 3),
thirty_four(34, 2, 2, 2, 3, 1),
thirty_five(35, 1, 1, 2, 3, 2),
thirty_six(36, 2, 2, 2, 3, 3);
int rouletteNum;
int oddOrEven;
int blackOrRed;
int highOrLow;
int whichDoz;
int whichColumn;
RouletteNumParam(int rouletteNum, int oddOrEven, int blackOrRed, int highOrLow, int whichDoz, int whichColumn) {
this.rouletteNum = rouletteNum;
this.oddOrEven = oddOrEven;
this.blackOrRed = blackOrRed;
this. highOrLow = highOrLow;
this.whichDoz = whichDoz;
this.whichColumn = whichColumn;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.github.zipcodewilmington.casino;

import java.util.HashMap;
import java.util.Map;
import java.util.Random;

public class RouletteTable {

private Random ball = new Random();
HashMap<Integer, String> numAssociation;

}

0 comments on commit a8b1576

Please sign in to comment.