GateDrawer.java added.
This commit is contained in:
parent
5c32997f8b
commit
96c3adba83
35
cicaprojekt/GateDrawer.java
Normal file
35
cicaprojekt/GateDrawer.java
Normal 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();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user