1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
public struct MyPoint {
public static const Empty = null;
private Point point;
public bool IsEmpty { get { return point.IsEmpty; } }
public int X { get { return point.X; } set { point.X = value; } }
public int Y { get { return point.Y; } set { point.Y = value; } }
public MyPoint(int x, int y) {
point = new Point(x, y);
}
// [... etc ... méthodes de Point qui t'intéresse]
public static MyPoint operator - (MyPoint p1, MyPoint p2) {
return new MyPoint(p1.X - p2.X, p1.Y - p1.Y);
}
internal Point Point { get { return point; } }
public static implicit operator Point(MyPoint p) {
return p.Point;
}
} |
Partager