asmrobot
2019-11-13 576b92fd82f568572bc4beb125fa0ba0191a602f
src/RichCreator.Utility/Structs/HousePathInfoObj.cs
@@ -1,4 +1,5 @@
using System;
using RichCreator.Utility.Maps;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -10,7 +11,8 @@
    {
        public HousePathInfoObj()
        {
            this.NextGates = new List<ParametersPointObj>();
            this.PathGuides = new List<ZTTargetPolygonObj>();
        }
        public HousePathInfoObj(Int32 width, Int32 height)
        {
@@ -49,14 +51,25 @@
        /// <summary>
        /// 循逻线
        /// 巡逻点
        /// </summary>
        public List<ZTLinePointObj> LoopLines { get; set; }
        public ZTPointObj LoopPoint { get; set; }
        /// <summary>
        /// 寻路线
        /// </summary>
        public List<ZTLinePointObj> FindPathLines { get; set; }
        /// <summary>
        /// 下一关进门点
        /// 参数意义 0:上 1:右  2:下  3:左
        /// </summary>
        public List<ParametersPointObj> NextGates { get; set; }
        /// <summary>
        /// 路径向导,把某一区域的点导向某一点
        /// </summary>
        public List<ZTTargetPolygonObj> PathGuides { get; set; }
        public HousePathInfo To()
        {
@@ -80,17 +93,34 @@
                info.FindPathPoints.Add(item.To());
            }
            info.LoopLines = new List<ZTLinePoint>();
            foreach (var item in this.LoopLines)
            if (this.LoopPoint == null)
            {
                info.LoopLines.Add(item.To());
                info.LoopPoint = ZTPoint.Empty;
            }
            else
            {
                info.LoopPoint = this.LoopPoint.To();
            }
            info.FindPathLines = new List<ZTLinePoint>();
            foreach (var item in this.FindPathLines)
            {
                info.FindPathLines.Add(item.To());
            }
            info.NextGates = new List<ParametersPoint>();
            foreach (var item in this.NextGates)
            {
                info.NextGates.Add(item.To());
            }
            info.PathGuides = new List<ZTTargetPolygon>();
            foreach (var item in this.PathGuides)
            {
                info.PathGuides.Add(item.To());
            }
            return info;
        }
@@ -117,11 +147,7 @@
                infoObj.FindPathPoints.Add(ZTPointObj.From(item));
            }
            infoObj.LoopLines = new List<ZTLinePointObj>();
            foreach (var item in info.LoopLines)
            {
                infoObj.LoopLines.Add(ZTLinePointObj.From(item));
            }
            infoObj.LoopPoint = ZTPointObj.From(info.LoopPoint);
            infoObj.FindPathLines = new List<ZTLinePointObj>();
            foreach (var item in info.FindPathLines)
@@ -129,6 +155,19 @@
                infoObj.FindPathLines.Add(ZTLinePointObj.From(item));
            }
            infoObj.NextGates = new List<ParametersPointObj>();
            foreach (var item in info.NextGates)
            {
                infoObj.NextGates.Add(ParametersPointObj.From(item));
            }
            infoObj.PathGuides = new List<ZTTargetPolygonObj>();
            foreach (var item in info.PathGuides)
            {
                infoObj.PathGuides.Add(ZTTargetPolygonObj.From(item));
            }
            return infoObj;