diff --git a/.gitignore b/.gitignore
index c4a79590..11e726de 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,7 @@ obj
# built application files
*.apk
*.ap_
+.vs
# nuget packages
packages
diff --git a/FreePIE.Core/FreePIE.Core.csproj b/FreePIE.Core/FreePIE.Core.csproj
index 43dfaa53..446cd6a5 100644
--- a/FreePIE.Core/FreePIE.Core.csproj
+++ b/FreePIE.Core/FreePIE.Core.csproj
@@ -118,6 +118,7 @@
+
diff --git a/FreePIE.Core/Model/Curve.cs b/FreePIE.Core/Model/Curve.cs
index 9e9a59be..c8253b0d 100644
--- a/FreePIE.Core/Model/Curve.cs
+++ b/FreePIE.Core/Model/Curve.cs
@@ -1,22 +1,25 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
namespace FreePIE.Core.Model
{
+
public class Curve
{
- public Curve(List points) : this(null, points) {}
+ public Curve(IEnumerable points) : this(null, points) {}
- public Curve(string name, List points)
+ public Curve(string name, IEnumerable points)
{
Name = name;
- Points = points;
+ Points = points.ToList();
ValidateCurve = true;
}
public Curve() {}
+ [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
public List Points { get; set; }
public string Name { get; set; }
public bool? ValidateCurve { get; set; }
@@ -43,8 +46,14 @@ private static List CalculateDefault(double yAxisMinValue, double yAxisMa
.Select(value => new Point(value, value))
.ToList();
}
- }
+ public override string ToString()
+ {
+ return "[" + string.Join(", ", Points.Select(p => $"({p.X}, {p.Y})")) + "]";
+ }
+
+ }
+ [DebuggerDisplay("({X}, {Y})")]
public struct Point
{
public Point(double x, double y) : this()
@@ -84,5 +93,26 @@ public bool Equals(Point other)
{
return X.Equals(other.X) && Y.Equals(other.Y);
}
+
+ public void Deconstruct(out double x, out double y)
+ {
+ x = this.X;
+ y = this.Y;
+ }
+
+ public static implicit operator Point((double x, double y) tuple)
+ {
+ return new Point(tuple.x, tuple.y);
+ }
+
+ public static implicit operator (double x, double y)(Point point)
+ {
+ return (point.X, point.Y);
+ }
}
+
+
+
}
+
+
diff --git a/FreePIE.Core/ScriptEngine/Globals/CurveGlobalProvider.cs b/FreePIE.Core/ScriptEngine/Globals/CurveGlobalProvider.cs
index d54c03b6..a7b5fa88 100644
--- a/FreePIE.Core/ScriptEngine/Globals/CurveGlobalProvider.cs
+++ b/FreePIE.Core/ScriptEngine/Globals/CurveGlobalProvider.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using FreePIE.Core.Common;
using FreePIE.Core.Contracts;
@@ -7,6 +8,7 @@
namespace FreePIE.Core.ScriptEngine.Globals
{
+
public class CurveGlobalProvider : IGlobalProvider
{
private readonly ISettingsManager settingsManager;
@@ -20,6 +22,7 @@ public IEnumerable