using System;
using System.Collections.Generic;
using Toolbox.Docking.Api.Data;

namespace Toolbox.Docking.Api.Chemical
{
    /// <summary>
    /// Represent chemical from QSAR training set and test set.
    /// </summary>
    [Serializable]
    public sealed class ChemicalWithData 
    {
        /// <summary>
        /// The chemical's Chemical Abstracts Service registry number.
        /// </summary>
        public int CasNumber { get; }
        /// <summary>
        /// The list of names for the chemical.
        /// </summary>
        public IReadOnlyList<string> ChemicalNames { get; }

        /// <summary>
        /// SMILES representation of the chemical's structure. 
        /// </summary>
        public string Smiles{ get; }

        /// <summary>
        /// Values of X desriptors used to derive QSAR.
        /// </summary>
        public TbDescribedData[] XValues { get; }

        /// <summary>
        /// Measured values of QSAR.
        /// </summary>
        public TbDescribedData YValue { get; }

        /// <summary>
        /// Constructor for a Toolbox ChemicalWithData. 
        /// </summary>
        /// <param name="cas">Chemical Abstracts Service registry number.</param>
        /// <param name="names">The list of names for the chemical.</param>
        /// <param name="smiles">SMILES representation of the chemical's structure.</param>
        /// <param name="xValues">Values of X desriptors used to derive QSAR.</param>
        /// <param name="yValue">Measured values of QSAR.</param>
        public ChemicalWithData(int cas, IEnumerable<string> names, string smiles, TbDescribedData[] xValues,
            TbDescribedData yValue) 
        {
            CasNumber = cas;

            ChemicalNames = new List<string>(names);

            Smiles = smiles;

            XValues = xValues;
            YValue = yValue;
        }
    }
}