getColor is now an array instead of a stupid method

oops
This commit is contained in:
Charlie 2014-08-02 16:46:43 -04:00
parent f0d95dc33e
commit 67f6b4681f

View File

@ -247,7 +247,7 @@ public class DiscoParty {
public void setDoFloor(boolean doFloor) { public void setDoFloor(boolean doFloor) {
this.doFloor = doFloor; this.doFloor = doFloor;
} }
public DiscoParty setGuestNumber(String key, int n) throws IllegalArgumentException { public DiscoParty setGuestNumber(String key, int n) throws IllegalArgumentException {
if (getMaxGuestNumbers().containsKey(key.toUpperCase())) { if (getMaxGuestNumbers().containsKey(key.toUpperCase())) {
if (n <= getMaxGuestNumbers().get(key.toUpperCase()) && n >= 0) { // so that /ds defaults can take 0 as arg if (n <= getMaxGuestNumbers().get(key.toUpperCase()) && n >= 0) { // so that /ds defaults can take 0 as arg
@ -395,62 +395,25 @@ public class DiscoParty {
entity.setVelocity(newVel); entity.setVelocity(newVel);
} }
private Color getColor(int i) { Color[] getColor = {
Color c = null; Color.AQUA,
if (i == 1) { Color.BLACK,
c = Color.AQUA; Color.BLUE,
} Color.FUCHSIA,
if (i == 2) { Color.GRAY,
c = Color.BLACK; Color.GREEN,
} Color.LIME,
if (i == 3) { Color.MAROON,
c = Color.BLUE; Color.NAVY,
} Color.OLIVE,
if (i == 4) { Color.ORANGE,
c = Color.FUCHSIA; Color.PURPLE,
} Color.RED,
if (i == 5) { Color.SILVER,
c = Color.GRAY; Color.TEAL,
} Color.WHITE,
if (i == 6) { Color.YELLOW
c = Color.GREEN; };
}
if (i == 7) {
c = Color.LIME;
}
if (i == 8) {
c = Color.MAROON;
}
if (i == 9) {
c = Color.NAVY;
}
if (i == 10) {
c = Color.OLIVE;
}
if (i == 11) {
c = Color.ORANGE;
}
if (i == 12) {
c = Color.PURPLE;
}
if (i == 13) {
c = Color.RED;
}
if (i == 14) {
c = Color.SILVER;
}
if (i == 15) {
c = Color.TEAL;
}
if (i == 16) {
c = Color.WHITE;
}
if (i == 17) {
c = Color.YELLOW;
}
return c;
}
void updateAll() { void updateAll() {
for (Sheep sheeple : getSheepList()) { for (Sheep sheeple : getSheepList()) {
@ -521,7 +484,7 @@ public class DiscoParty {
int numColours = r.nextInt(3) + 1; int numColours = r.nextInt(3) + 1;
Color[] colourArray = new Color[numColours]; Color[] colourArray = new Color[numColours];
for (int i = 0; i < numColours; i++) { for (int i = 0; i < numColours; i++) {
colourArray[i] = getColor(r.nextInt(17) + 1); colourArray[i] = getColor[r.nextInt(17)];
} }
// randomize effects // randomize effects