| | |
| | | /// </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> |
| | |
| | | /// <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; |
| | | } |
| | |
| | | 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; |
| | |
| | | { |
| | | return false; |
| | | } |
| | | if (line.P1 == line.P2) |
| | | if (line.P1 .Equals( line.P2)) |
| | | { |
| | | return false; |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | |
| | | |
| | | 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; |
| | | } |
| | |
| | | /// 寻找巡逻路线 |
| | | /// </summary> |
| | | /// <param name="rolePosition"></param> |
| | | public static void FindLoopPath(ZTPoint rolePosition) |
| | | public void FindLoopPath(ZTPoint rolePosition) |
| | | { |
| | | |
| | | } |
| | |
| | | /// </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>(); |
| | | } |
| | | |
| | | |