Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public int Dot(Vector that)
 {
     return this.X * that.X + this.Y * that.Y;
 }
Exemplo n.º 5
0
 public TurtleState(Vector pos, double angle, Color c)
 {
     this.Position = pos;
     this.Angle = angle;
     this.DrawColor = c;
 }