package cicaprojekt;

import java.io.IOException;

public class PlayerBaseDrawer extends AbstractDrawer implements Drawer {
    PlayerBase playerbase;
    
    public PlayerBaseDrawer(PlayerBase pb) throws IOException {
        super("Replicator_Down.png");
        playerbase = pb;
    }

    @Override
    public void draw() throws IOException {
        switch(playerbase.name){
            case "Replicator":
                switch(playerbase.facingDirection){
                    case NORTH: 
                        changeImage("Replicator_Up.png");
                        break;
                    case EAST:
                        changeImage("Replicator_Right.png");
                        break;
                    case SOUTH:
                        changeImage("Replicator_Down.png");
                        break;
                    default:
                        changeImage("Replicator_Left.png");
                        break;
            }
        }
        if(playerbase.isDestroyed())
            changeImage("Empty.png");
    }

    @Override
    public int getTileX() {
        return playerbase.currentTile.getX();
    }

    @Override
    public int getTileY() {
        return playerbase.currentTile.getY();
    }

}
