| | |
| | | /// <summary> |
| | | /// 点 |
| | | /// </summary> |
| | | public struct ZTPoint : IEquatable<ZTPoint> |
| | | public class ZTPoint |
| | | { |
| | | public static ZTPoint Empty = new ZTPoint(0, 0); |
| | | public static ZTPoint Empty = new ZTPoint(0,0); |
| | | |
| | | public ZTPoint() |
| | | { |
| | | |
| | | } |
| | | public ZTPoint(Int32 x, Int32 y) |
| | | { |
| | | this.X = x; |
| | | this.Y = y; |
| | | } |
| | | public Int32 X; |
| | | |
| | | public Int32 Y; |
| | | |
| | | public Int32 X { 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 Int32 Y { get; set; } |
| | | |
| | | public static ZTPoint operator +(ZTPoint a, ZTPoint b) |
| | | { |
| | | return new ZTPoint(a.X + b.X, a.Y + b.Y); |
| | |
| | | #region IEquatable |
| | | public bool Equals(ZTPoint other) |
| | | { |
| | | if (other == null) |
| | | { |
| | | return false; |
| | | } |
| | | if (this.X == other.X && this.Y == other.Y) |
| | | { |
| | | return true; |