public Turtle(Vector pos, double angle, ImmutableStack<TurtleState> stack, Action<int, int, int, int, Color> drawLine, Color c) { this.Position = pos; this.Angle = angle; this.Stack = stack; this.DrawLine = drawLine; this.DrawColor = c; }
public LSystem(string axiom, ImmutableDictionary<char, string> rules, int iterations, double angle, string name, int distance, Vector startPos) { this.Axiom = axiom; this.Rules = rules; this.Iterations = iterations; this.Name = name; this.Distance = distance; this.StartPos = startPos; this.Angle = angle; }
public void TestForward() { var turtle = new Turtle(new Vector(0, 0), 0.0, ImmutableStack<Turtle.TurtleState>.Empty, dummy, Colors.Black); var forward = turtle.Forward(15); var expected = new Vector(15, 0); var actual = forward.Position; Assert.AreEqual(expected, actual); }
public int Dot(Vector that) { return this.X * that.X + this.Y * that.Y; }
public TurtleState(Vector pos, double angle, Color c) { this.Position = pos; this.Angle = angle; this.DrawColor = c; }