Quellcode durchsuchen

Merge branch 'master' of nsatinover/ZCW-OOP-Casino into master

jonathan-hinds vor 6 Jahren
Ursprung
Commit
34b6c08a75

+ 7
- 0
src/main/java/io/zipcoder/casino/Card.java Datei anzeigen

@@ -1,4 +1,11 @@
1 1
 package io.zipcoder.casino;
2 2
 
3 3
 public class Card {
4
+    private String suit;
5
+    private boolean isVisible;
6
+    private int value;
7
+    private String name;
8
+
9
+
10
+
4 11
 }

+ 24
- 0
src/main/java/io/zipcoder/casino/CardGame.java Datei anzeigen

@@ -1,4 +1,28 @@
1 1
 package io.zipcoder.casino;
2 2
 
3
+import java.util.HashMap;
4
+
3 5
 public class CardGame {
6
+    private boolean isFaceUp; // Deal() will change IF card is visible
7
+    private int tablePot;
8
+    private int minBet;
9
+    private int maxBet;
10
+    private int handSize;
11
+    private Player playersTurn;
12
+    private Player[] players;
13
+
14
+
15
+    CardGame(int minBet, int maxBet){
16
+        this.minBet = minBet;
17
+        this.maxBet = maxBet;
18
+    }
19
+
20
+    public void Deal(){
21
+        //faceUp/ faceDown
22
+    }
23
+
24
+    public void Shuffle(){
25
+
26
+    }
27
+
4 28
 }

+ 13
- 0
src/main/java/io/zipcoder/casino/CardPlayer.java Datei anzeigen

@@ -0,0 +1,13 @@
1
+package io.zipcoder.casino;
2
+
3
+import java.util.ArrayList;
4
+import java.util.HashMap;
5
+
6
+public class CardPlayer {
7
+    private Player player;
8
+    /*
9
+    private HashMap<Player, Card[]> hand = new HashMap<Player, Card[]>();
10
+    private ArrayList<Card> cardhand = new ArrayList<Card>();
11
+    private ArrayList<Card> discard = new ArrayList<Card>()
12
+    */
13
+}

+ 21
- 0
src/main/java/io/zipcoder/casino/Console.java Datei anzeigen

@@ -0,0 +1,21 @@
1
+package io.zipcoder.casino;
2
+
3
+public class Console {
4
+    private Game[] games;
5
+
6
+    Console(){
7
+        Yahtzee yahtzee = new Yahtzee();
8
+        Stud stud = new Stud;
9
+        War war = new War;
10
+        games = new Game[yahtzee, stud, war];
11
+    }
12
+
13
+
14
+    public void createAccount(){
15
+
16
+    }
17
+
18
+    public void chooseGame(String gameName){
19
+
20
+    }
21
+}

+ 4
- 0
src/main/java/io/zipcoder/casino/Deck.java Datei anzeigen

@@ -1,4 +1,8 @@
1 1
 package io.zipcoder.casino;
2 2
 
3
+import java.util.ArrayList;
4
+import java.util.Collections;
5
+
3 6
 public class Deck {
7
+    ArrayList<Card> deck = new ArrayList<Card>();
4 8
 }

+ 7
- 0
src/main/java/io/zipcoder/casino/Dice.java Datei anzeigen

@@ -1,4 +1,11 @@
1 1
 package io.zipcoder.casino;
2 2
 
3 3
 public class Dice {
4
+    private int sides;
5
+    private int value;
6
+    private ScoreSheet scoreSheet;
7
+
8
+    public void Roll(){
9
+
10
+    }
4 11
 }

+ 4
- 0
src/main/java/io/zipcoder/casino/DiceGame.java Datei anzeigen

@@ -1,4 +1,8 @@
1 1
 package io.zipcoder.casino;
2 2
 
3 3
 public class DiceGame {
4
+    private int amoutdice;
5
+    int numberOfRolls;
6
+    private Player[] players;
7
+    private Player playersTrun;
4 8
 }

+ 8
- 0
src/main/java/io/zipcoder/casino/DicePlayer.java Datei anzeigen

@@ -0,0 +1,8 @@
1
+package io.zipcoder.casino;
2
+
3
+import java.util.HashMap;
4
+
5
+public class DicePlayer {
6
+    private Player player;
7
+    HashMap<Player, Dice[]> tableDice = new HashMap<Player, Dice[]>();
8
+}

+ 3
- 0
src/main/java/io/zipcoder/casino/Gamble.java Datei anzeigen

@@ -1,4 +1,7 @@
1 1
 package io.zipcoder.casino;
2 2
 
3 3
 public interface Gamble {
4
+    public void Bet(int betAmount);
5
+    public int Payout(int payoutAmount);
6
+    public void Ante(int anteAmount);
4 7
 }

+ 3
- 0
src/main/java/io/zipcoder/casino/Game.java Datei anzeigen

@@ -1,4 +1,7 @@
1 1
 package io.zipcoder.casino;
2 2
 
3 3
 public interface Game {
4
+    public void Play();
5
+    public void Quit();
6
+    public void StartRound();
4 7
 }

+ 25
- 0
src/main/java/io/zipcoder/casino/Player.java Datei anzeigen

@@ -1,4 +1,29 @@
1 1
 package io.zipcoder.casino;
2 2
 
3 3
 public class Player {
4
+    private int initialBalance;
5
+    private int currentBalance;
6
+    private String name;
7
+
8
+    Player(String name, int initialBalance){
9
+        this.name = name;
10
+        this.initialBalance = initialBalance;
11
+    }
12
+
13
+    public int getInitialBalance() {
14
+        return initialBalance;
15
+    }
16
+
17
+    public int getCurrentBalance() {
18
+        return currentBalance;
19
+    }
20
+
21
+    public void changeBalance(int addOrSubtract) {
22
+        this.currentBalance += addOrSubtract;
23
+    }
24
+
25
+    public String getName() {
26
+        return name;
27
+    }
28
+
4 29
 }

+ 21
- 0
src/main/java/io/zipcoder/casino/ScoreSheet.java Datei anzeigen

@@ -1,4 +1,25 @@
1 1
 package io.zipcoder.casino;
2 2
 
3 3
 public class ScoreSheet {
4
+    private int score;
5
+
6
+    ScoreSheet(){
7
+        this.score = 0;
8
+    }
9
+
10
+    public int getScore() {
11
+        return score;
12
+    }
13
+
14
+    public void setScore(int score) {
15
+        this.score = score;
16
+    }
17
+
18
+    public void printScore(){
19
+        System.out.println(score);
20
+    }
21
+
22
+    public void setRow(String setRow){
23
+
24
+    }
4 25
 }

+ 44
- 1
src/main/java/io/zipcoder/casino/Stud.java Datei anzeigen

@@ -1,4 +1,47 @@
1 1
 package io.zipcoder.casino;
2 2
 
3
-public class Stud {
3
+public class Stud extends CardGame implements Gamble, Game {
4
+    public Stud(int minBet, int maxBet) {
5
+        super(minBet, maxBet);
6
+    }
7
+
8
+
9
+    public void determineWinner(){
10
+
11
+    }
12
+
13
+    public void fold(){
14
+
15
+    }
16
+
17
+    /**
18
+     * Below 3 Implemented from Gamble
19
+     * @param betAmount
20
+     */
21
+    public void Bet(int betAmount) {
22
+
23
+    }
24
+
25
+    public int Payout(int payoutAmount) {
26
+        return 0;
27
+    }
28
+
29
+    public void Ante(int anteAmount) {
30
+
31
+    }
32
+
33
+    /**
34
+     * Below 3 Implemented from Game
35
+     */
36
+    public void Play() {
37
+
38
+    }
39
+
40
+    public void Quit() {
41
+
42
+    }
43
+
44
+    public void StartRound() {
45
+
46
+    }
4 47
 }

+ 50
- 1
src/main/java/io/zipcoder/casino/War.java Datei anzeigen

@@ -1,4 +1,53 @@
1 1
 package io.zipcoder.casino;
2 2
 
3
-public class War {
3
+import java.util.HashMap;
4
+
5
+public class War extends CardGame implements Gamble, Game {
6
+
7
+    War(int minBet, int maxBet) {
8
+        super(minBet, maxBet);
9
+    }
10
+
11
+    public void playCard(){
12
+
13
+    }
14
+
15
+    public void warMethod(){
16
+
17
+    }
18
+
19
+    public void determineWinner(){
20
+
21
+    }
22
+
23
+    /**
24
+     * Below 3 Implemented from Gamble
25
+     * @param betAmount
26
+     */
27
+    public void Bet(int betAmount) {
28
+
29
+    }
30
+
31
+    public int Payout(int payoutAmount) {
32
+        return 0;
33
+    }
34
+
35
+    public void Ante(int anteAmount) {
36
+
37
+    }
38
+
39
+    /**
40
+     * Below 3 Implemented from Game
41
+     */
42
+    public void Play() {
43
+
44
+    }
45
+
46
+    public void Quit() {
47
+
48
+    }
49
+
50
+    public void StartRound() {
51
+
52
+    }
4 53
 }

+ 32
- 0
src/main/java/io/zipcoder/casino/Yahtzee.java Datei anzeigen

@@ -0,0 +1,32 @@
1
+package io.zipcoder.casino;
2
+
3
+public class Yahtzee extends DiceGame implements Game{
4
+    private Dice[] cup;
5
+
6
+
7
+    public void compareScore(Player player1, Player player2){
8
+
9
+    }
10
+
11
+    public void reRoll(){
12
+
13
+    }
14
+
15
+    public void stopRoll(){
16
+
17
+    }
18
+    /**
19
+     * implemented from 'Game'
20
+     */
21
+    public void Play() {
22
+
23
+    }
24
+
25
+    public void Quit() {
26
+
27
+    }
28
+
29
+    public void StartRound() {
30
+
31
+    }
32
+}

+ 0
- 4
src/main/java/io/zipcoder/casino/Yhatzee.java Datei anzeigen

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