-
Notifications
You must be signed in to change notification settings - Fork 2
/
Crazy8Driver.html
280 lines (280 loc) · 15.9 KB
/
Crazy8Driver.html
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_25) on Sat Oct 18 15:10:10 PDT 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Crazy8Driver</title>
<meta name="date" content="2014-10-18">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Crazy8Driver";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">Crazy8</div>
<h2 title="Class Crazy8Driver" class="title">Class Crazy8Driver</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>Crazy8.Crazy8Driver</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">Crazy8Driver</span>
extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../Crazy8/Crazy8Driver.html#Crazy8Driver()">Crazy8Driver</a></strong>()</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a><Crazy8.Card>></code></td>
<td class="colLast"><code><strong><a href="../Crazy8/Crazy8Driver.html#dealCards(Crazy8.LStack, int, java.util.ArrayList)">dealCards</a></strong>(Crazy8.LStack<Crazy8.Card> deck,
int players,
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a><Crazy8.Player> playerList)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private static boolean</code></td>
<td class="colLast"><code><strong><a href="../Crazy8/Crazy8Driver.html#discard(java.util.Scanner, Crazy8.Player, Crazy8.LStack)">discard</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html?is-external=true" title="class or interface in java.util">Scanner</a> userin,
Crazy8.Player player,
Crazy8.LStack<Crazy8.Card> discardPile)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private static void</code></td>
<td class="colLast"><code><strong><a href="../Crazy8/Crazy8Driver.html#helpMenu()">helpMenu</a></strong>()</code>
<div class="block">Print out and handle user input for a series of interactive menus that offer rules, context, and assistance to players.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a><Crazy8.Player></code></td>
<td class="colLast"><code><strong><a href="../Crazy8/Crazy8Driver.html#instantiatePlayers(java.util.ArrayList)">instantiatePlayers</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a><Crazy8.Player> playerCache)</code>
<div class="block">This class is used to offer the player input to select a character to play as, how many AI opponents they will face,
and randomly select their AI opponents.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../Crazy8/Crazy8Driver.html#main(java.lang.String[])">main</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] args)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private static Crazy8.LStack<Crazy8.Card></code></td>
<td class="colLast"><code><strong><a href="../Crazy8/Crazy8Driver.html#makeDeck()">makeDeck</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private static void</code></td>
<td class="colLast"><code><strong><a href="../Crazy8/Crazy8Driver.html#pacedDialogue(java.lang.String, Crazy8.Player)">pacedDialogue</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> dialogue,
Crazy8.Player character)</code>
<div class="block">pacedDialogue is a method we use that enters input and then tells the computer to wait.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private static void</code></td>
<td class="colLast"><code><strong><a href="../Crazy8/Crazy8Driver.html#playerTurn(Crazy8.LStack, java.util.ArrayList, Crazy8.LStack)">playerTurn</a></strong>(Crazy8.LStack<Crazy8.Card> deck,
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a><Crazy8.Player> playerList,
Crazy8.LStack<Crazy8.Card> cardStack)</code>
<div class="block">This class should handle everything that goes on during a player's turn.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a><Crazy8.Player></code></td>
<td class="colLast"><code><strong><a href="../Crazy8/Crazy8Driver.html#populatePlayerCache()">populatePlayerCache</a></strong>()</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="Crazy8Driver()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Crazy8Driver</h4>
<pre>public Crazy8Driver()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="main(java.lang.String[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>main</h4>
<pre>public static void main(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] args)</pre>
</li>
</ul>
<a name="playerTurn(Crazy8.LStack, java.util.ArrayList, Crazy8.LStack)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>playerTurn</h4>
<pre>private static void playerTurn(Crazy8.LStack<Crazy8.Card> deck,
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a><Crazy8.Player> playerList,
Crazy8.LStack<Crazy8.Card> cardStack)</pre>
<div class="block">This class should handle everything that goes on during a player's turn.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>deck</code> - The deck we might be drawing from.</dd><dd><code>The</code> - list of players (their hands included) we're working with.</dd><dd><code>cardStack</code> - The growing stack of cards.</dd></dl>
</li>
</ul>
<a name="discard(java.util.Scanner, Crazy8.Player, Crazy8.LStack)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>discard</h4>
<pre>private static boolean discard(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html?is-external=true" title="class or interface in java.util">Scanner</a> userin,
Crazy8.Player player,
Crazy8.LStack<Crazy8.Card> discardPile)</pre>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>userin</code> - The scanner to read from.</dd><dd><code>player</code> - Our player.</dd><dd><code>discardPile</code> - The growing discard pile.</dd>
<dt><span class="strong">Returns:</span></dt><dd>If a card was discarded or not.</dd></dl>
</li>
</ul>
<a name="pacedDialogue(java.lang.String, Crazy8.Player)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>pacedDialogue</h4>
<pre>private static void pacedDialogue(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> dialogue,
Crazy8.Player character)</pre>
<div class="block">pacedDialogue is a method we use that enters input and then tells the computer to wait. This makes it so that the player can notice and process
the dialogue, instead of it all happening at once. Usually, .pacedDialogue() will be followed another call to this method, resembling some
artificial pause in speech.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dialogue</code> - The string to print out.</dd><dd><code>character</code> - The speaker for this line of dialogue.</dd></dl>
</li>
</ul>
<a name="helpMenu()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>helpMenu</h4>
<pre>private static void helpMenu()</pre>
<div class="block">Print out and handle user input for a series of interactive menus that offer rules, context, and assistance to players.</div>
</li>
</ul>
<a name="instantiatePlayers(java.util.ArrayList)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>instantiatePlayers</h4>
<pre>private static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a><Crazy8.Player> instantiatePlayers(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a><Crazy8.Player> playerCache)</pre>
<div class="block">This class is used to offer the player input to select a character to play as, how many AI opponents they will face,
and randomly select their AI opponents.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>playerCache</code> - The cache of players to take a character from.</dd>
<dt><span class="strong">Returns:</span></dt><dd>A list of players for the game.</dd></dl>
</li>
</ul>
<a name="dealCards(Crazy8.LStack, int, java.util.ArrayList)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>dealCards</h4>
<pre>private static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a><Crazy8.Card>> dealCards(Crazy8.LStack<Crazy8.Card> deck,
int players,
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a><Crazy8.Player> playerList)</pre>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>deck</code> - A collection of cards to randomly deal cards from.</dd><dd><code>players</code> - The number of players to deal a hand to.</dd><dd><code>playerList</code> - The list of players to deal cards to.</dd>
<dt><span class="strong">Returns:</span></dt><dd>A collection of hands filled with 8 cards from the deck.</dd></dl>
</li>
</ul>
<a name="makeDeck()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>makeDeck</h4>
<pre>private static Crazy8.LStack<Crazy8.Card> makeDeck()</pre>
<dl><dt><span class="strong">Returns:</span></dt><dd>A new, randomly filled deck of the four suits, 1 through Ace.</dd></dl>
</li>
</ul>
<a name="populatePlayerCache()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>populatePlayerCache</h4>
<pre>private static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a><Crazy8.Player> populatePlayerCache()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
</body>
</html>