GateDrawer.java added.

This commit is contained in:
ericnerdo 2016-05-07 16:08:25 +02:00
parent 5c32997f8b
commit 96c3adba83

View File

@ -0,0 +1,35 @@
package cicaprojekt;
import java.io.IOException;
public class GateDrawer extends ImagePanel implements Drawer{
Gate gate;
public GateDrawer(Gate g) throws IOException {
super("ClosedGate.png");
gate = g;
setVisible(false);
}
@Override
public void draw() throws IOException {
if(gate.isOpen())
changeImage("OpenGate.png");
else
changeImage("ClosedGate.png");
setVisible(true);
}
@Override
public int getX() {
return gate.getX();
}
@Override
public int getY() {
return gate.getY();
}
}