using System;

namespace Toolbox.Docking.Api.Units
{
    /// <summary>
    /// This class represents a Ratio type scale.
    /// </summary>
    [Serializable]
    public sealed class TbRatioScale : TbScale
    {
        /// <summary>
        /// Base unit for the scale.
        /// </summary>
        public string BaseUnit { get; }

        /// <summary>
        /// Constructor for the ratio scale object.
        /// </summary>
        /// <param name="name">Name for the scale.</param>
        /// <param name="familyGroup">Family group for the scale.</param>
        /// <param name="identity">The unique persistent identifier for the scale.</param>
        /// <param name="baseUnit">Base unit for the ratio scale.</param>
        public TbRatioScale(string name, string familyGroup, Guid identity, string baseUnit) : base(name, familyGroup, identity)
        {
            BaseUnit = baseUnit ?? throw new ArgumentException("TbRatioScale base unit cannot be null!");
        }

        /// <summary>
        /// Constructor for the ratio scale object.
        /// </summary>
        /// <param name="fromScale">The existing scale</param>
        /// <param name="baseUnit">Predefined base unit</param>
        public TbRatioScale(TbRatioScale fromScale, string baseUnit) :
            this(fromScale.Name, fromScale.FamilyGroup, fromScale.Identity, baseUnit)
        {

        }
    }
}
