Skip to content

Commit 0b17c63

Browse files
authored
Update ControlDesk.java
1 parent a9ee3a8 commit 0b17c63

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

BowlingAlley/code/ControlDesk.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,10 @@ class ControlDesk extends Thread {
4747

4848
/** The collection of Lanes */
4949
private HashSet lanes;
50-
5150
/** The party wait queue */
5251
private Queue partyQueue;
53-
5452
/** The number of lanes represented */
5553
private int numLanes;
56-
5754
/** The collection of subscribers */
5855
private Vector subscribers;
5956

@@ -68,15 +65,11 @@ public ControlDesk(int numLanes) {
6865
this.numLanes = numLanes;
6966
lanes = new HashSet(numLanes);
7067
partyQueue = new Queue();
71-
7268
subscribers = new Vector();
73-
7469
for (int i = 0; i < numLanes; i++) {
7570
lanes.add(new Lane());
7671
}
77-
7872
this.start();
79-
8073
}
8174

8275
/**
@@ -85,9 +78,7 @@ public ControlDesk(int numLanes) {
8578
*/
8679
public void run() {
8780
while (true) {
88-
8981
assignLane();
90-
9182
try {
9283
sleep(250);
9384
} catch (Exception e) {}
@@ -106,18 +97,14 @@ public void run() {
10697

10798
private Bowler registerPatron(String nickName) {
10899
Bowler patron = null;
109-
110100
try {
111101
// only one patron / nick.... no dupes, no checks
112-
113102
patron = BowlerFile.getBowlerInfo(nickName);
114-
115103
} catch (FileNotFoundException e) {
116104
System.err.println("Error..." + e);
117105
} catch (IOException e) {
118106
System.err.println("Error..." + e);
119107
}
120-
121108
return patron;
122109
}
123110

@@ -128,10 +115,8 @@ private Bowler registerPatron(String nickName) {
128115

129116
public void assignLane() {
130117
Iterator it = lanes.iterator();
131-
132118
while (it.hasNext() && partyQueue.hasMoreElements()) {
133119
Lane curLane = (Lane) it.next();
134-
135120
if (curLane.isPartyAssigned() == false) {
136121
System.out.println("ok... assigning this party");
137122
curLane.assignParty(((Party) partyQueue.next()));

0 commit comments

Comments
 (0)