package agenda;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by gjoosen on 06/02/15.
 */
public class Act implements Serializable  {
    
    private List<Artist> artists;
    private Stage stage;
    private String genre, name;
    private ActTime actTime;
    private int popularity;
    
    public Act(String name, Stage stage, String genre, ActTime actTime, int popularity, Artist... artists){
        this.name = name;
        this.stage = stage; 
        this.genre = genre;
        this.actTime = actTime;
        this.popularity = popularity;

        this.artists = new ArrayList<Artist>();
        for(Artist artist: artists) {
            this.artists.add(artist);
        }
    }

    /**
     * * returns a list with all the artists that are in the act.
     * @return all artists.
     */
    public List<Artist> getArtists() {
        return artists;
    }

    /**
     * * returns the stage the act plays on.
     * @return stage
     */
    public Stage getStage() {
        return stage;
    }
    
    public void setStage(Stage stage) {
		this.stage = stage;
	}
    public void setTime(ActTime actTime){
        this.actTime = actTime;
    }
    
    /**
     * * returns the genre of the act.
     * @return the genre of the act.
     */
    public String getGenre() {
        return genre;
    }

    /**
     * *
     * @return act name
     */
    public String getName() {
        return name;
    }

    /**
     * * return the act time.
     * @return the act time object
     */
    public ActTime getActTime() {
        return this.actTime;
    }
    
    @Override
    public String toString(){
        String string = "<html>";
        string+="Artists: ";
        for(Artist artist: this.artists){
            string += artist.getName() + "<br/>";
        }
        string+= "Genre: \n" + this.genre + "<br/>";
        string+= "Stage: \n" + this.stage.getName() + "<br/>";
        string+= this.actTime;
        string+= "</html>";
        return string;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setGenre(String genre) {
        this.genre = genre;
    }

    public void setArtists(Artist[] artists) {
        this.artists = new ArrayList<>();
        for(Artist artist: artists){
            this.artists.add(artist);
        }
    }

    public int getPopularity() {
        return popularity;
    }

    public void setPopularity(int popularity) {
        this.popularity = popularity;
    }

    public void setActTime(ActTime actTime) {
        this.actTime = actTime;
    }
}
