Esempio n. 1
0
        private IEnumerable <LifeStep> IterateSteps(LifePoint from, Decision by, bool withAlternatives)
        {
            var p1 = new LifePoint(
                time: from.Time + by.TimeDuration,
                position: from.Position,
                value: from.Value,
                reality: by.Reality);
            var p2 = new LifePoint(
                time: p1.Time + by.TimeDelta,
                position: p1.Position + by.Shift,
                value: p1.Value + by.Value,
                reality: by.Reality);

            yield return(new LifeStep(from, p1));

            yield return(new LifeStep(p1, p2));

            if (by.FollowUp != null)
            {
                foreach (var s in IterateSteps(p2, by.FollowUp, withAlternatives))
                {
                    yield return(s);
                }
            }
            if (withAlternatives && by.Alternatives != null)
            {
                foreach (var a in by.Alternatives)
                {
                    foreach (var s in IterateSteps(p2, a, true))
                    {
                        yield return(s);
                    }
                }
            }
        }
Esempio n. 2
0
        private PointF TransformLifePoint(LifePoint lp)
        {
            var innerHeight = Options.CanvasSize.Height - Options.Padding.Vertical;
            var horizon     = Options.Padding.Top + innerHeight * (1f - Options.HorizonRatio);

            return(new PointF(
                       Options.Padding.Left + lp.Time * Options.TimeStretch,
                       horizon - lp.Position * Options.PositionStretch));
        }
Esempio n. 3
0
 public LifeStep(LifePoint from, LifePoint to)
 {
     From = from;
     To   = to;
 }