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,42 @@
namespace CandyboxPlugin.Recipe
{
public class CandyParameter
{
private Point? _originalPoint;
public Queue<float[]> Histogram { get; set; } = new Queue<float[]>();
public Point Position { get; set; }
public int OuterRadius { get; set; }
public int InnerRadius { get; set; }
public float Weight { get; set; } = 1;
public void ResetPoint()
{
if (_originalPoint != null)
{
Position = _originalPoint.Value;
}
}
public void RotatePoint(Point centerPoint, double angleInRadians)
{
_originalPoint = Position;
double cosTheta = Math.Cos(angleInRadians);
double sinTheta = Math.Sin(angleInRadians);
Position = new Point
{
X =
(int)
(cosTheta * (Position.X - centerPoint.X) -
sinTheta * (Position.Y - centerPoint.Y) + centerPoint.X),
Y =
(int)
(sinTheta * (Position.X - centerPoint.X) +
cosTheta * (Position.Y - centerPoint.Y) + centerPoint.Y)
};
}
}
}