namespace ZionSchematics.Models.SearchNearestTypes
{
    public class NearestFactory
    {
        private const string constElement = "ELEMENT";
        private const string constPageBottomEdge = "PAGEBOTTOMEDGE";
        private const string constPageLeftEdge = "PAGELEFTEDGE";
        private const string constPageRightEdge = "PAGERIGHTEDGE";
        private const string constPageTopEdge = "PAGETOPEDGE";
        private const string constPoints = "POINTS";
        private const string constXCoordinate = "XCOORDINATE";
        private const string constYCoordinate = "YCOORDINATE";

        public static INearest Construct(string type)
        {
            switch (type.ToUpper())
            {
                case constElement: return new Element();
                case constPageBottomEdge: return new PageBottomEdge();
                case constPageLeftEdge: return new PageLeftEdge();
                case constPageRightEdge: return new PageRightEdge();
                case constPageTopEdge: return new PageTopEdge();
                case constPoints: return new Points();
                case constXCoordinate: return new XCoordinate();
                case constYCoordinate: return new YCoordinate();
                default: return null;
            }
        }
    }
}
