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 current level.
 */
public class LevelLabel extends GameObject {

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

    /**
     * Create a label for the level with default values.
     *
     * @param gameView the {@link GameView} to display the level label
     */
    public LevelLabel(GameView gameView){
        super(gameView);
        size = 1;
        width = 109;
        height = 8;
        level = 1;
        setPosition(GameView.WIDTH/2.0 - width,GameView.HEIGHT-height-60);
    }

    /**
     * Draws the level label onto the canvas of the {@link GameView}.
     */
    @Override
    public void addToCanvas(){
        gameView.addTextToCanvas("Level "+level,getPosition().x,getPosition().y,40,Color.YELLOW,0);
    }

    /**
     * Set the current level number.
     *
     * @param level the level number
     */
    public void setLevel(int level) {
        this.level = level;
    }

    @Override
    public void updateStatus() {

    }
}
