-
Notifications
You must be signed in to change notification settings - Fork 41
/
Casino.puml
179 lines (140 loc) · 2.51 KB
/
Casino.puml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
@startuml
'https://plantuml.com/sequence-diagram
class PlayerClass {
private String playerName;
private final int playerID;
private int wallet;
private int chipBalance;
get/setter name;
get ID;
get/set chipBalance;
get/set wallet;
addToWallet;
wageMoney;
cashOut;
getMoreChips;
}
interface Game {
playGame;
checkWinner;
}
interface GamblingGame {
addToPot;
winPot;
}
interface GamblingPlayer {
wageMoney;
cashOut;
getMoreChips;
}
abstract class CardGame {
private ArrayList<Cards> deck;
private ArrayList<Cards> discardPile;
private ArrayList<Cards> playerHand;
private ArrayList<Cards> dealerHand;
playGame;
checkWinner;
makeDeck;
shuffleDeck;
dealCards;
discardPile;
}
abstract class DiceGame {
private int totalNumOfDice;
ArrayList<Integers> playerDiceHand;
int sizeOfPot;
playGame;
checkWinner;
addToPot;
winPot;
rollDice;
}
class ChipMoneyExchange {
chipsToMoney;
moneyToChips;
}
class GoFish {
ArrayList<Cards> playerHand;
ArrayList<Cards> dealerHand;
int numOfPlayerMatches;
int numOfDealerMatches;
doYouHaveCard;
removeCardFromHand;
addToPlayerMatches;
addToDealerMatches;
checkWinner;
}
class BlackJack {
ArrayList<Cards> playerHand;
ArrayList<Cards> playerSplitHand;
ArrayList<Cards> dealerHand;
ArrayList<Cards> dealerSplitHand;
int playerTotal;
int dealerTotal;
int sizeOfPot;
addToPot;
winPot;
checkWinner;
splitHand;
hitMe;
(boolean)didIBust;
}
class Craps {
String stateOfGame(passOrNot);
int currentRound;
}
class ExtraDiceGame {
ArrayList<Integer> dealerDiceHand;
int playerCount;
int dealerCount;
countMatches;
checkWinner;
holdDice(int... index);
}
class PlayerWarehouse {
HashSet<UserID, player> currentPlayers;
addPlayer;
removePlayer;
howManyPlayers;
}
class PlayerFactory {
createPlayer;
}
class CardFactory {
createCard;
}
class CardMaker {
private String nameOfCard;
private String suitOfCard;
private int valueOfCard;
}
class Display {
enterCasinoScreen;
chipMoneyExchangeScreen;
chooseGameScreen;
goFish(all the screens);
blackJack(all the screens);
craps(all the screens);
extraDiceGame(all the screens);
}
class cardWarehouse {
ArrayList<Cards> deckOfCards;
}
class MainCasino {
runCasino;
}
DiceGame <|--- Craps
DiceGame <|--- ExtraDiceGame
CardGame <|--- GoFish
CardGame <|--- BlackJack
Game <|--- GamblingGame
GamblingGame <|--- BlackJack
GamblingGame <|--- DiceGame
GamblingPlayer <|-- PlayerClass
Game <|-- CardGame
'Alice -> Bob: Authentication Request
'Bob --> Alice: Authentication Response
'
'Alice -> Bob: Another authentication Request
'Alice <-- Bob: another authentication Response
@enduml