using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ModelData.BusinessModel
{

    //!По хорошему сделать структурой а не классом

    public class Position
    {
        #region Data

        public double X { set; get; }
        public double Y { set; get; }

        #endregion

        #region Constructor

        public Position()
        {
            X = 0;
            Y = 0;
        }
        public Position(VDS.RDF.INode long_, VDS.RDF.INode lat_)
        {
            this.X = double.Parse(long_.ToString().Split('^')[0].Replace('.', ','));
            this.Y = double.Parse(lat_.ToString().Split('^')[0].Replace('.', ','));
        }
        public Position(double x, double y)
        {
            this.X = x;
            this.Y = y;
        }
        public Position(Position origin)
        {
            X = origin.X;
            Y = origin.Y;
        }

        #endregion

        #region operator
        public static Position operator +(Position p1, Position p2)
        {
            return new Position
            {
                X = p1.X + p2.X,
                Y = p1.Y + p2.Y
            };
        }

        #endregion
    }
}
