UV
using Autodesk.DesignScript.Interfaces;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
namespace Autodesk.DesignScript.Geometry
{
    public class UV
    {
        internal IUVEntity UVEntity { get; set; }
        public double U => UVEntity.get_U();
        public double V => UVEntity.get_V();
        internal UV(IUVEntity host, bool persist)
        {
            UVEntity = host;
        }
        public override string ToString()
        {
            string[] obj = new string[5] {
                "UV(U = ",
                null,
                null,
                null,
                null
            };
            double num = U;
            obj[1] = num.ToString(GeometryExtension.DoublePrintFormat, CultureInfo.InvariantCulture);
            obj[2] = ", V = ";
            num = V;
            obj[3] = num.ToString(GeometryExtension.DoublePrintFormat, CultureInfo.InvariantCulture);
            obj[4] = ")";
            return string.Concat(obj);
        }
        public override bool Equals(object other)
        {
            if (base.Equals(other))
                return true;
            UV uV = other as UV;
            if (uV == null)
                return false;
            double num = uV.U;
            if (num.Equals(U)) {
                num = uV.V;
                return num.Equals(V);
            }
            return false;
        }
        public override int GetHashCode()
        {
            int num = 17;
            int num2 = num * 23;
            double num3 = U;
            num = num2 + num3.GetHashCode();
            int num4 = num * 23;
            num3 = V;
            return num4 + num3.GetHashCode();
        }
        internal static UV Wrap(IUVEntity host, bool persist = true)
        {
            if (host == null)
                return null;
            return new UV(host, persist);
        }
        internal static UV[] Wrap(IUVEntity[] hosts, bool persist = true)
        {
            return (from x in hosts
            select Wrap(x, persist)).ToArray();
        }
        internal static UV[][] Wrap(IUVEntity[][] hosts, bool persist = true)
        {
            return (from x in hosts
            select Wrap(x, persist)).ToArray();
        }
        internal static IUVEntity[][] Unwrap(UV[][] o)
        {
            return (from x in o
            select Unwrap(x)).ToArray();
        }
        internal static IUVEntity[] Unwrap(UV[] o)
        {
            return (from x in o
            select Unwrap(x)).ToArray();
        }
        internal static IUVEntity[] Unwrap(IEnumerable<UV> o)
        {
            return (from x in o
            select Unwrap(x)).ToArray();
        }
        internal static IUVEntity Unwrap(UV o)
        {
            return o.UVEntity;
        }
        public static UV ByCoordinates(double u = 0, double v = 0)
        {
            return Wrap(HostFactory.Factory.UVByCoordinates(u, v), true);
        }
    }
}
            