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 {

    /** Lives count */
    private int lifeCount;

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

        this.lifeCount = 0;

        setPosition(10,GameView.HEIGHT - height - 5);
    }

    @Override
    public void addToCanvas() {
        for(int i=0;i<lifeCount;i++){
            gameView.addImageToCanvas("livesIcon.png",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() {

    }
}
