-
Notifications
You must be signed in to change notification settings - Fork 0
/
SvgSegment.cs
32 lines (27 loc) · 978 Bytes
/
SvgSegment.cs
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
32
using System.Collections.Generic;
namespace RT.Coordinates
{
internal struct SvgSegment
{
public List<Vertex> Vertices;
public bool Closed;
public SvgSegment(List<Vertex> vertices, bool closed)
{
Vertices = vertices;
Closed = closed;
}
public override bool Equals(object obj) => obj is SvgSegment other && EqualityComparer<List<Vertex>>.Default.Equals(Vertices, other.Vertices) && Closed == other.Closed;
public override int GetHashCode()
{
var hashCode = 574668419;
hashCode = hashCode * -1521134295 + EqualityComparer<List<Vertex>>.Default.GetHashCode(Vertices);
hashCode = hashCode * -1521134295 + Closed.GetHashCode();
return hashCode;
}
public void Deconstruct(out List<Vertex> vertices, out bool closed)
{
vertices = this.Vertices;
closed = this.Closed;
}
}
}