package de.thdeg.greiner.superpangworld.graphics.immovable;

import de.thdeg.greiner.superpangworld.gameview.GameView;
import de.thdeg.greiner.superpangworld.graphics.base.GameObject;

/**
 * The label to display the remaining lives.
 */
public class LivesLabel extends GameObject {

    private final static String ICON =
                    "  RR   RR  \n"+
                    " RRRR RRRR \n"+
                    "RRRRRRRRRRR\n"+
                    "RRRRRRRRRRR\n"+
                    " RRRRRRRRR \n"+
                    "  RRRRRRR  \n"+
                    "   RRRRR   \n"+
                    "    RRR    \n"+
                    "     R     \n";

    private int lifeCount;

    /**
     * Create lives label.
     *
     * @param gameView the gameView
     */
    public LivesLabel(GameView gameView) {
        super(gameView);
        rotation = 0;
        size = 5;
        width = 12;
        height = 12;

        this.lifeCount = 0;

        position.setTo(0,GameView.HEIGHT-50);
    }

    @Override
    public void addToCanvas() {
        for(int i=0;i<lifeCount;i++){
            gameView.addBlockImageToCanvas(ICON,position.x + (i*size*width),position.y,size,rotation);
        }
    }

    /**
     * Set the current life count.
     *
     * @param lifeCount the lives
     */
    public void setLifeCount(int lifeCount) {
        this.lifeCount = lifeCount;
    }

    @Override
    public void updateStatus() {

    }
}
