38 lines
720 B
Java
38 lines
720 B
Java
package cicaprojekt;
|
|
|
|
import java.io.IOException;
|
|
|
|
public class FieldDrawer extends ImagePanel implements Drawer {
|
|
|
|
Field field;
|
|
|
|
public FieldDrawer(Field f) throws IOException {
|
|
super("Field.png");
|
|
field = f;
|
|
setVisible(false);
|
|
}
|
|
|
|
@Override
|
|
public void draw() throws IOException {
|
|
if(field.hasBox())
|
|
changeImage("Box.png");
|
|
else if(field.hasZPM())
|
|
changeImage("ZPM.png");
|
|
else
|
|
changeImage("Field.png");
|
|
|
|
setVisible(true);
|
|
}
|
|
|
|
@Override
|
|
public int getTileX() {
|
|
return field.getX();
|
|
}
|
|
|
|
@Override
|
|
public int getTileY() {
|
|
return field.getY();
|
|
}
|
|
|
|
}
|