Clients now can call getX and getY for objects which implement Drawer.

GapDrawer.java added
This commit is contained in:
ericnerdo 2016-05-07 14:04:05 +02:00
parent 3ef7bdd411
commit 098f0cba62
2 changed files with 30 additions and 1 deletions

View File

@ -3,5 +3,6 @@ package cicaprojekt;
public interface Drawer {
public void draw();
public int getX();
public int getY();
}

View 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();
}
}