Пример #1
0
        public static Step TakeStep(this Step step, Torsion twist)
        {
            var direction = step.Direction.Turn(twist);
            var node      = step.Node.Links[direction];

            return(new Step(node, direction, twist, step));
        }
Пример #2
0
        public Step(Node node, Direction direction, Torsion twist, Step previous)
        {
            Node      = node;
            Previous  = previous;
            Direction = direction;
            Twist     = twist;

            if (previous is not null)
            {
                Count   = previous.Count + 1;
                Torsion = previous.Torsion + twist;
            }
            else
            {
                Count   = 0;
                Torsion = Torsion.None;
            }
        }