Clients now can call getX and getY for objects which implement Drawer.
GapDrawer.java added
This commit is contained in:
parent
3ef7bdd411
commit
098f0cba62
@ -3,5 +3,6 @@ package cicaprojekt;
|
|||||||
public interface Drawer {
|
public interface Drawer {
|
||||||
|
|
||||||
public void draw();
|
public void draw();
|
||||||
|
public int getX();
|
||||||
|
public int getY();
|
||||||
}
|
}
|
||||||
|
28
cicaprojekt/GapDrawer.java
Normal file
28
cicaprojekt/GapDrawer.java
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
package cicaprojekt;
|
||||||
|
|
||||||
|
public class GapDrawer extends ImagePanel implements Drawer{
|
||||||
|
|
||||||
|
private Gap gap;
|
||||||
|
|
||||||
|
public GapDrawer(Gap g) {
|
||||||
|
super("Gap.png");
|
||||||
|
gap = g;
|
||||||
|
setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw() {
|
||||||
|
setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getX() {
|
||||||
|
return gap.getX();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getY() {
|
||||||
|
return gap.getY();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user