mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-23 00:58:48 +00:00
Use auto-property for Polygon and Polyhedron
This ensures a new instance is created
This commit is contained in:
parent
32485b727a
commit
0e62f233f0
@ -7,11 +7,6 @@ namespace X10D.Drawing;
|
||||
/// </summary>
|
||||
public class Polygon : IEquatable<Polygon>
|
||||
{
|
||||
/// <summary>
|
||||
/// The empty polygon. That is, a polygon with no vertices.
|
||||
/// </summary>
|
||||
public static readonly Polygon Empty = new();
|
||||
|
||||
private readonly List<Point> _vertices = new();
|
||||
|
||||
/// <summary>
|
||||
@ -38,6 +33,15 @@ public class Polygon : IEquatable<Polygon>
|
||||
_vertices = new List<Point>(vertices);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets an empty polygon. That is, a polygon with no vertices.
|
||||
/// </summary>
|
||||
/// <value>An empty polygon.</value>
|
||||
public static Polygon Empty
|
||||
{
|
||||
get => new();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether this polygon is convex.
|
||||
/// </summary>
|
||||
|
@ -9,11 +9,6 @@ namespace X10D.Drawing;
|
||||
/// </summary>
|
||||
public class PolygonF
|
||||
{
|
||||
/// <summary>
|
||||
/// The empty polygon. That is, a polygon with no vertices.
|
||||
/// </summary>
|
||||
public static readonly PolygonF Empty = new();
|
||||
|
||||
private readonly List<PointF> _vertices = new();
|
||||
|
||||
/// <summary>
|
||||
@ -67,6 +62,15 @@ public class PolygonF
|
||||
_vertices = new List<PointF>(vertices);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets an empty polygon. That is, a polygon with no vertices.
|
||||
/// </summary>
|
||||
/// <value>An empty polygon.</value>
|
||||
public static PolygonF Empty
|
||||
{
|
||||
get => new();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether this polygon is convex.
|
||||
/// </summary>
|
||||
|
@ -8,11 +8,6 @@ namespace X10D.Drawing;
|
||||
/// </summary>
|
||||
public class Polyhedron : IEquatable<Polyhedron>
|
||||
{
|
||||
/// <summary>
|
||||
/// The empty polyhedron. That is, a polyhedron with no points.
|
||||
/// </summary>
|
||||
public static readonly Polyhedron Empty = new();
|
||||
|
||||
private readonly List<Vector3> _vertices = new();
|
||||
|
||||
/// <summary>
|
||||
@ -48,6 +43,15 @@ public class Polyhedron : IEquatable<Polyhedron>
|
||||
_vertices = new List<Vector3>(vertices);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets an empty polyhedron. That is, a polygon with no vertices.
|
||||
/// </summary>
|
||||
/// <value>An empty polyhedron.</value>
|
||||
public static Polyhedron Empty
|
||||
{
|
||||
get => new();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether this polyhedron is convex.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user