/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package unitn.rovereto.folgarait.pierre.alloggi;

import javafx.geometry.Pos;
import javafx.scene.control.Label;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Polygon;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;

/**
 *
 * @author pierre.folgarait
 */
public class Hotel extends Alloggio {

    int stelle;
    Label voti; //da sostituire con stackPane con dentro le stelle/altra HBox
    Circle stars;
    Polygon str;

    /**
     *
     * @param nome Nome Hotel
     * @param prezzo Prezzo Hotel
     * @param valutazione Valutazione Hotel
     * @param stelle Numero stelle Hotel
     * @param main Finestra Principale
     */
    public Hotel(String nome, int prezzo, double valutazione, int stelle, mainWindow main) {
        super(nome, prezzo, valutazione, main);
        if (stelle >= 1 & stelle <= 5) {
            this.stelle = stelle;
        } else {
            this.stelle = 0;
        }

        /*voti = new Label("" + this.stelle);
        voti.setFont(Font.font("Arial", FontWeight.LIGHT, 15));*/
        HBox draw = new HBox(5);
        draw.setAlignment(Pos.CENTER);

        for (int i = 0; i < this.stelle; i++) {
            /*stars = new Circle(9);
            stars.setFill(Color.YELLOW);
            stars.setStroke(Color.BLACK);
            stelline.getChildren().add(stars);*/

            str = new Polygon(new double[]{
                9.0, 0.0,
                2.8, 8.5,
                -7.3, 5.3,
                -7.3, -5.3,
                2.8, -8.5,
            });
            str.setFill(Color.YELLOW);
            str.setStroke(Color.BLACK);
            str.setRotate(-18.0);
            draw.getChildren().add(str);
        }
        getChildren().add(draw);
        //getChildren().add(voti);

    }

}
