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/ZTPoint.cs |   34 +++++++++++-----------------------
 1 files changed, 11 insertions(+), 23 deletions(-)

diff --git a/src/RichCreator.Utility/Structs/ZTPoint.cs b/src/RichCreator.Utility/Structs/ZTPoint.cs
index cd58bed..5bc4c14 100644
--- a/src/RichCreator.Utility/Structs/ZTPoint.cs
+++ b/src/RichCreator.Utility/Structs/ZTPoint.cs
@@ -9,10 +9,14 @@
     /// <summary>
     /// 点
     /// </summary>
-    public class ZTPoint : IEquatable<ZTPoint>
+    public class ZTPoint 
     {
-        public static ZTPoint Empty = default(ZTPoint);
+        public static ZTPoint Empty = new ZTPoint(0,0);
 
+        public ZTPoint()
+        {
+
+        }
         public ZTPoint(Int32 x, Int32 y)
         {
             this.X = x;
@@ -23,27 +27,7 @@
         public Int32 X { get; set; }
 
         public Int32 Y { get; set; }
-
-
-
-        public static bool operator ==(ZTPoint a, ZTPoint b)
-        {
-            if (a.X == b.X && a.Y == b.Y)
-            {
-                return true;
-            }
-            return false;
-        }
-
-        public static bool operator !=(ZTPoint a, ZTPoint b)
-        {
-            if (a.X != b.X || a.Y != b.Y)
-            {
-                return true;
-            }
-            return false;
-        }
-
+        
         public static ZTPoint operator +(ZTPoint a, ZTPoint b)
         {
             return new ZTPoint(a.X + b.X, a.Y + b.Y);
@@ -92,6 +76,10 @@
         #region IEquatable
         public bool Equals(ZTPoint other)
         {
+            if (other == null)
+            {
+                return false;
+            }
             if (this.X == other.X && this.Y == other.Y)
             {
                 return true;

--
Gitblit v1.9.3