WallDrawer.java fixed. Looks like asking a null reference's name is not a
good idea.
This commit is contained in:
parent
e63a62893e
commit
f241695413
@ -14,6 +14,9 @@ public class WallDrawer extends ImagePanel implements Drawer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw() throws IOException {
|
public void draw() throws IOException {
|
||||||
|
if(wall.getStargate() == null)
|
||||||
|
changeImage("Wall.png");
|
||||||
|
else{
|
||||||
switch(wall.getStargate().getName()){
|
switch(wall.getStargate().getName()){
|
||||||
case "Blue Stargate":
|
case "Blue Stargate":
|
||||||
changeImage("BlueStargate.png");
|
changeImage("BlueStargate.png");
|
||||||
@ -24,16 +27,16 @@ public class WallDrawer extends ImagePanel implements Drawer {
|
|||||||
case "Red Stargate":
|
case "Red Stargate":
|
||||||
changeImage("RedStargate.png");
|
changeImage("RedStargate.png");
|
||||||
break;
|
break;
|
||||||
case "GreenStargate":
|
case "Green Stargate":
|
||||||
changeImage("GreenStargate.png");
|
changeImage("GreenStargate.png");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
changeImage("Wall.png");
|
changeImage("Wall.png");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user