before candybox editor update

This commit is contained in:
meelstorm
2025-09-16 10:42:43 +02:00
parent e5746ef766
commit dc12b3e51a
103 changed files with 96379 additions and 343 deletions

View File

@@ -0,0 +1,31 @@
namespace CandyboxPlugin.Voronoi
{
public class Edge
{
public VoronoiPoint Point1 { get; }
public VoronoiPoint Point2 { get; }
public Edge(VoronoiPoint point1, VoronoiPoint point2)
{
Point1 = point1;
Point2 = point2;
}
public override bool Equals(object obj)
{
if (obj == null) return false;
if (obj.GetType() != GetType()) return false;
var edge = obj as Edge;
var samePoints = Point1 == edge.Point1 && Point2 == edge.Point2;
var samePointsReversed = Point1 == edge.Point2 && Point2 == edge.Point1;
return samePoints || samePointsReversed;
}
public override int GetHashCode()
{
int hCode = (int)Point1.X ^ (int)Point1.Y ^ (int)Point2.X ^ (int)Point2.Y;
return hCode.GetHashCode();
}
}
}