Ejemplo n.º 1
0
        private List <List <Vector2 <float> > > GetGroupedBezier()
        {
            var copiedCurvePoints = CurvePoints.ToList();

            copiedCurvePoints.Insert(0, StartPoint);

            var list    = new List <List <Vector2 <float> > >();
            var current = new List <Vector2 <float> >();

            list.Add(current);
            for (int i = 0; i < copiedCurvePoints.Count; i++)
            {
                var @this = copiedCurvePoints[i];
                current.Add(@this);
                if (i == copiedCurvePoints.Count - 1)
                {
                    break;
                }

                var next = copiedCurvePoints[i + 1];

                if (Math.Abs(@this.X - next.X) < 0.01 && Math.Abs(@this.Y - next.Y) < 0.01)
                {
                    current = new List <Vector2 <float> >();
                    list.Add(current);
                }
            }

            return(list);
        }
Ejemplo n.º 2
0
 private static void RenderRainFallFactors(CurvePoints factors)
 {
     if ((factors?.Points.Any()).GetValueOrDefault())
     {
         CONS.WriteLine($"      points");
         foreach (var li in factors.Points)
         {
             CONS.WriteLine($"          li: {li.ToStringOrDefault()}");
         }
     }
 }
Ejemplo n.º 3
0
 private static void RenderMoodCurve(CurvePoints curve)
 {
     if ((curve?.Points.Any()).GetValueOrDefault())
     {
         CONS.WriteLine($"      randomMentalStateMtbDaysMoodCurve");
         foreach (var li in curve.Points)
         {
             CONS.WriteLine($"        li: {li.ToStringOrDefault()}");
         }
     }
 }
Ejemplo n.º 4
0
        /***************************************/
        /*               METHODS               */
        /***************************************/

        /// <summary>
        /// Initialies graph data. If the graph is not realtime, then performs all calculations necessary to display static graph.
        /// </summary>
        private void Start()
        {
            // Instantiate new graph line variables
            Line = new CurvePoints();
            Line.OnLineChange += UpdateColors;
            Line.OnLineChange += UpdateRenderer;

            // Clear and set all data to empty
            Clear();

            // Prepare the Y axis variables
            LowestY  = y.defaultValue;
            HighestY = y.defaultValue;
        }
Ejemplo n.º 5
0
        public override string ToString()
        {
            var    sampleList = new List <(ObjectSamplesetType, ObjectSamplesetType)>();
            string edgeSampleStr;
            string edgeHitsoundStr;

            if (EdgeSamples != null)
            {
                for (var i = 0; i < EdgeSamples.Length; i++)
                {
                    var objectSamplesetType = EdgeSamples[i];
                    var objectAdditionType  = EdgeAdditions[i];
                    sampleList.Add((objectSamplesetType, objectAdditionType));
                }

                edgeSampleStr = "," + string.Join("|", sampleList.Select(k => $"{(int)k.Item1}:{(int)k.Item2}"));
            }
            else
            {
                edgeSampleStr = "";
            }

            if (EdgeHitsounds != null)
            {
                edgeHitsoundStr = "," + string.Join("|", EdgeHitsounds.Select(k => $"{(int)k}"));
            }
            else
            {
                edgeHitsoundStr = "";
            }

            return(string.Format("{0}|{1},{2},{3}{4}{5}",
                                 SliderType.ParseToCode(),
                                 string.Join("|", CurvePoints.Select(k => $"{k.X}:{k.Y}")),
                                 Repeat,
                                 PixelLength,
                                 edgeHitsoundStr,
                                 edgeSampleStr));
        }
Ejemplo n.º 6
0
 public IEnumerator GetEnumerator()
 {
     return(CurvePoints.GetEnumerator());
 }
Ejemplo n.º 7
0
 public void ConvertToMM()
 {
     RepeatDistance *= Tools.Ft2MmScale;
     CurvePoints.ForEach(c => c.ConvertToMM());
 }