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

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

import java.awt.*;

/**
 * The label to display the score.
 */
public class ScoreLabel extends GameObject {

    /** The score to display */
    private int score;

    /**
     * Create a label for the score with default values.
     *
     * @param gameView the {@link GameView} to display the score label
     */
    public ScoreLabel(GameView gameView) {
        super(gameView);
        score = 0;
        size = 1;
        width = (int) size * 100;
        height = (int) size * 8;

        setPosition(0,GameView.HEIGHT-height-60);
    }

    @Override
    public void addToCanvas() {
        gameView.addTextToCanvas(Integer.toString(score),getPosition().x,getPosition().y,30, Color.YELLOW,0);
    }

    /**
     * Set the game score.
     *
     * @param score the score
     */
    public void setScore(int score) {
        this.score = score;
    }

    @Override
    public void updateStatus() {
    }
}
