Vertex
using Autodesk.DesignScript.Interfaces;
using System.Collections.Generic;
using System.Linq;
namespace Autodesk.DesignScript.Geometry
{
    public class Vertex : DesignScriptEntity
    {
        internal IVertexEntity VertexEntity => HostImpl as IVertexEntity;
        public Point PointGeometry => Point.Wrap(VertexEntity.get_PointGeometry(), true);
        public Edge[] AdjacentEdges => Track(Edge.Wrap(VertexEntity.get_AdjacentEdges(), true));
        public Face[] AdjacentFaces => Track(Face.Wrap(VertexEntity.get_AdjacentFaces(), true));
        internal Vertex(IVertexEntity host, bool persist)
            : base(host, persist)
        {
        }
        public override string ToString()
        {
            return "Vertex(PointGeometry = " + PointGeometry?.ToString() + ")";
        }
        internal static Vertex Wrap(IVertexEntity host, bool persist = true)
        {
            if (host == null)
                return null;
            return new Vertex(host, persist);
        }
        internal static Vertex[] Wrap(IVertexEntity[] hosts, bool persist = true)
        {
            return (from x in hosts
            select Wrap(x, persist)).ToArray();
        }
        internal static Vertex[][] Wrap(IVertexEntity[][] hosts, bool persist = true)
        {
            return (from x in hosts
            select Wrap(x, persist)).ToArray();
        }
        internal static IVertexEntity[][] Unwrap(Vertex[][] o)
        {
            return (from x in o
            select Unwrap(x)).ToArray();
        }
        internal static IVertexEntity[] Unwrap(Vertex[] o)
        {
            return (from x in o
            select Unwrap(x)).ToArray();
        }
        internal static IVertexEntity[] Unwrap(IEnumerable<Vertex> o)
        {
            return (from x in o
            select Unwrap(x)).ToArray();
        }
        internal static IVertexEntity Unwrap(Vertex o)
        {
            return o.VertexEntity;
        }
    }
}
            