﻿namespace MusicShopManager.Models
{
    using System;
    using Interfaces;

    public abstract class Guitar : Instrument, IGuitar
    {
        private const int StringCount = 6;
        private string bodyWood;
        private string fingerboardWood;

        public Guitar(string make, string model, decimal price, string color, string bodyWood, string fingerboardWood) 
            : base(make, model, price, color)
        {
            this.BodyWood = bodyWood;
            this.FingerboardWood = fingerboardWood;
        }

        public string BodyWood
        {
            get
            {
                return this.bodyWood;
            }
            set
            {
                if (value == null || value == string.Empty)
                {
                    throw new ArgumentException("The Body wood is required");
                }

                this.bodyWood = value;
            }
        }

        public string FingerboardWood
        {
            get
            {
                return this.fingerboardWood;
            }
            set
            {
                if (value == null || value == string.Empty)
                {
                    throw new ArgumentException("The Fingerboard wood is required");
                }

                this.fingerboardWood = value;
            }
        }

        public virtual int NumberOfStrings
        {
            get
            {
                return Guitar.StringCount;
            }
        }

        public override string ToString()
        {
            return base.ToString() + string.Format("\nStrings: {0}\nBody wood: {1}\nFingerboard wood: {2}", this.NumberOfStrings, this.BodyWood, this.FingerboardWood);
        }
    }
}