PlayerBaseDrawer.java added.

This commit is contained in:
ericnerdo 2016-05-07 22:27:16 +02:00
parent 25fd8189d2
commit e63a62893e

View File

@ -0,0 +1,49 @@
package cicaprojekt;
import java.io.IOException;
public class PlayerBaseDrawer extends ImagePanel implements Drawer {
PlayerBase playerbase;
public PlayerBaseDrawer(PlayerBase pb) throws IOException {
super("Replicator.png");
playerbase = pb;
setVisible(false);
}
@Override
public void draw() throws IOException {
//TODO Pictures for different facing directions.
switch(playerbase.name){
case "Replicator":
switch(playerbase.facingDirection){
case NORTH:
changeImage("ONeill.png");
break;
case EAST:
changeImage("ONeill.png");
break;
case SOUTH:
changeImage("ONeill.png");
break;
default:
changeImage("ONeill.png");
break;
}
}
setVisible(true);
}
@Override
public int getTileX() {
return playerbase.currentTile.getX();
}
@Override
public int getTileY() {
return playerbase.currentTile.getY();
}
}