49 lines
1.2 KiB
Java
49 lines
1.2 KiB
Java
package cicaprojekt;
|
|
|
|
import java.io.IOException;
|
|
|
|
public class WallDrawer extends AbstractDrawer implements Drawer {
|
|
private Wall wall;
|
|
|
|
public WallDrawer(Wall w) throws IOException {
|
|
super("Wall.png");
|
|
wall = w;
|
|
}
|
|
|
|
@Override
|
|
public void draw() throws IOException {
|
|
if(wall.getStargate() == null)
|
|
changeImage("Wall.png");
|
|
else{
|
|
switch(wall.getStargate().getName()){
|
|
case "Blue Stargate":
|
|
changeImage("BlueStargate.png");
|
|
break;
|
|
case "Yellow Stargate":
|
|
changeImage("YellowStargate.png");
|
|
break;
|
|
case "Red Stargate":
|
|
changeImage("RedStargate.png");
|
|
break;
|
|
case "Green Stargate":
|
|
changeImage("GreenStargate.png");
|
|
break;
|
|
default:
|
|
changeImage("Wall.png");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public int getTileX() {
|
|
return wall.getX();
|
|
}
|
|
|
|
@Override
|
|
public int getTileY() {
|
|
return wall.getY();
|
|
}
|
|
|
|
}
|