From f25f89101a98ad815c0ae2d25e1a8dc35d53a5dd Mon Sep 17 00:00:00 2001
From: asmrobot <asmrobot@hotmail.com>
Date: Tue, 29 Oct 2019 13:55:37 +0000
Subject: [PATCH] format state machine

---
 src/RichCreator.Utility/Structs/HousePathInfo.cs |   27 ++++++++++++++++-----------
 1 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/src/RichCreator.Utility/Structs/HousePathInfo.cs b/src/RichCreator.Utility/Structs/HousePathInfo.cs
index 82379df..0f59774 100644
--- a/src/RichCreator.Utility/Structs/HousePathInfo.cs
+++ b/src/RichCreator.Utility/Structs/HousePathInfo.cs
@@ -94,16 +94,16 @@
         /// </summary>
         /// <param name="obstacle"></param>
         /// <returns></returns>
-        public void RemoveObstacle(ZTPolygon obstacle)
+        public bool RemoveObstacle(ZTPolygon obstacle)
         {
             Int32 index = 0;
             if (!ExistsObstacle(out index, obstacle))
             {
-                return;
+                return true;
             }
 
             this.Obstacles.RemoveAt(index);
-            return;
+            return true;
         }
 
         /// <summary>
@@ -134,7 +134,7 @@
         /// <returns></returns>
         public bool AddLocationPosition(ParametersPoint point)
         {
-            if (this.LocationPoints.Exists((p) => { return point.Point == p.Point; }))
+            if (this.LocationPoints.Exists((p) => { return point.Point.Equals(p.Point); }))
             {
                 return false;
             }
@@ -204,7 +204,7 @@
             index = 0;
             for (int i = 0; i < this.FindPathPoints.Count; i++)
             {
-                if (this.FindPathPoints[i] == point)
+                if (this.FindPathPoints[i].Equals(point))
                 {
                     index = i;
                     return true;
@@ -225,7 +225,7 @@
             {
                 return false;
             }
-            if (line.P1 == line.P2)
+            if (line.P1 .Equals( line.P2))
             {
                 return false;
             }
@@ -331,7 +331,7 @@
         {
             for (int i = 0; i < this.LoopLines.Count; i++)
             {
-                if (this.LoopLines[i].P1 == point || this.LoopLines[i].P2 == point)
+                if (this.LoopLines[i].P1.Equals(point) || this.LoopLines[i].P2.Equals(point))
                 {
                     return true;
                 }
@@ -339,7 +339,7 @@
 
             for (int i = 0; i < this.FindPathLines.Count; i++)
             {
-                if (this.FindPathLines[i].P1 == point || this.FindPathLines[i].P2 == point)
+                if (this.FindPathLines[i].P1 .Equals( point) || this.FindPathLines[i].P2.Equals(point))
                 {
                     return true;
                 }
@@ -375,7 +375,7 @@
         /// 寻找巡逻路线
         /// </summary>
         /// <param name="rolePosition"></param>
-        public static void FindLoopPath(ZTPoint rolePosition)
+        public void FindLoopPath(ZTPoint rolePosition)
         {
 
         }
@@ -385,9 +385,14 @@
         /// </summary>
         /// <param name="start"></param>
         /// <param name="end"></param>
-        public static void FindPath(ZTPoint start, ZTPoint end)
+        public List<ZTPoint> FindPath(ZTPoint start, ZTPoint end)
         {
-
+            //查询两点间是否连通
+            //查找两点是否在障碍物里,如果在则计算出来的最短距离
+            //计算最近的寻路点
+            //计算寻路点的最短路径
+            //得出所有路径点
+            return new List<ZTPoint>();
         }
 
 

--
Gitblit v1.9.3