WallDrawer.java fixed. Looks like asking a null reference's name is not a

good idea.
This commit is contained in:
ericnerdo 2016-05-07 23:24:51 +02:00
parent e63a62893e
commit f241695413

View File

@ -14,26 +14,29 @@ public class WallDrawer extends ImagePanel implements Drawer {
@Override @Override
public void draw() throws IOException { public void draw() throws IOException {
switch(wall.getStargate().getName()){ if(wall.getStargate() == null)
case "Blue Stargate": changeImage("Wall.png");
changeImage("BlueStargate.png"); else{
break; switch(wall.getStargate().getName()){
case "Yellow Stargate": case "Blue Stargate":
changeImage("YellowStargate.png"); changeImage("BlueStargate.png");
break; break;
case "Red Stargate": case "Yellow Stargate":
changeImage("RedStargate.png"); changeImage("YellowStargate.png");
break; break;
case "GreenStargate": case "Red Stargate":
changeImage("GreenStargate.png"); changeImage("RedStargate.png");
break; break;
default: case "Green Stargate":
changeImage("Wall.png"); changeImage("GreenStargate.png");
break; break;
} default:
changeImage("Wall.png");
setVisible(true); break;
}
}
setVisible(true);
} }
@Override @Override