public void AddPoint(Vector2 vector, EaseFunction function) { if (vector.X < 0f) { throw new ArgumentException("X value of point is not in valid range!"); } EasePoint newPoint = new EasePoint(vector, function); if (_points.Count == 0) { _points.Add(newPoint); return; } EasePoint last = _points[_points.Count - 1]; if (last.Point.X > vector.X) { throw new ArgumentException("New point has an x value less than the previous point when it should be greater or equal"); } _points.Add(newPoint); }
public void AddPoint(float x, float y, EaseFunction function) => AddPoint(new Vector2(x, y), function);
public EasePoint(Vector2 p, EaseFunction func) { Point = p; Function = func; }