package com.moviesdb;

import javafx.scene.image.Image;

public class Movie {

    private int movie_ID;
    public String movie_Name;
    public String movie_Genre;
    public String movie_Description;
    public String movie_Duration;
    public String movie_Rating;
    public String movie_Year;
    public String movie_Studio;
    public String movie_Director;

    public String movie_ImageLink;


    //--------Get methods

    public int id(){
        if (movie_ID > 0)
            return movie_ID;
        else
            return -1;
    }

    public String name(){
        if (movie_Name != null)
            return movie_Name;
        else
            return "Movie_name_undefined";
    }

    public String genre(){
        if (movie_Genre != null)
            return movie_Genre;
        else
            return "Movie_genre_undefined";
    }

    public String description(){
        if (movie_Description != null)
            return movie_Description;
        else
            return "Movie_description_undefined";
    }

    public String duration(){
        if (movie_Duration != null)
            return movie_Duration;
        else
            return "Movie_duration_undefined";
    }

    public String rating(){
        if (movie_Rating != null)
            return movie_Rating;
        else
            return "Movie_rating_undefined";
    }

    public String year(){
        if (movie_Year != null)
            return movie_Year;
        else
            return "Movie_year_undefined";
    }

    public String studio(){
        if (movie_Studio != null)
            return movie_Studio;
        else
            return "Movie_studio_undefined";
    }

    public String director(){
        if (movie_Director != null)
            return movie_Director;
        else
            return "Movie_director_undefined";
    }

    public Image cover(){
        if (movie_ImageLink != null) {
            Image image = new Image(movie_ImageLink);
            return image;
        }
        else {
            Image image = new Image(getClass().getResourceAsStream("media\\coverplaceholder.jpg"));
            return image;
        }
    }

    //--------Set methods

    public int setId(int newID){
        movie_ID = newID;
        return 0;
    }

    public int setName(String newName) {
        movie_Name = newName;
        return 0;
    }

    public int setGenre(String newGenre){
        movie_Genre = newGenre;
        return 0;
    }

    public int setDescription(String newDescription){
        movie_Description = newDescription;
        return 0;
    }

    public int setDuration(String newDuration){
        movie_Duration = newDuration;
        return 0;
    }

    public int setRating(String newRating){
        movie_Rating = newRating;
        return 0;
    }

    public int setYear(String newYear){
        movie_Year = newYear;
        return 0;
    }

    public int setStudio(String newStudio){
        movie_Studio = newStudio;
        return 0;
    }

    public int setDirector(String newDirector){
        movie_Director = newDirector;
        return 0;
    }

    public int setCover(String newImageLink){
        movie_ImageLink = newImageLink;
        return 0;
    }
}
