using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace BoxOfficeDashboard.Models
{
    public class Studio : INotifyPropertyChanged
    {
        private string _name;
        public string Name
        {
            get
            {
                return _name;
            }
            set
            {
                _name = value;
                OnPropertyChanged("Name");
            }
        }

        private double _share;
        public double Share
        {
            get
            {
                return _share;
            }
            set
            {
                _share = value;
                OnPropertyChanged("Share");
            }
        }

        private double _gross;
        public double Gross
        {
            get
            {
                return _gross;
            }
            set
            {
                _gross = value;
                OnPropertyChanged("Gross");
            }
        }

        private double _totalMovies;
        public double TotalMovies
        {
            get
            {
                return _totalMovies;
            }
            set
            {
                _totalMovies = value;
                OnPropertyChanged("TotalMovies");
            }
        }

        public double GrossPerMovie
        {
            get
            {
                if (this.TotalMovies != 0)
                    return this.Gross / this.TotalMovies;
                else
                    return double.NaN;
            }
        }

        private double _year;
        public double Year
        {
            get
            {
                return _year;
            }
            set
            {
                _year = value;
                OnPropertyChanged("Year");
            }
        }

        public Studio(double year, string name, double share, double gross, double movies)
        {
            this._year = year;
            this._name = name;
            this._share = share;
            this._gross = gross;
            this._totalMovies = movies;
        }

        public event PropertyChangedEventHandler PropertyChanged;
        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }

    }

    public class StudioYear
    {

    }
}
