slogo.instruction.drawing
Class Towards

java.lang.Object
  extended by slogo.language.GrammarElement
      extended by slogo.instruction.Instruction
          extended by slogo.instruction.drawing.Towards

public class Towards
extends Instruction

returns a heading the turtle should be facing to point from its current position to the given position

Author:
tshishikub

Field Summary
(package private)  GrammarElement myX
           
(package private)  GrammarElement myY
           
 
Fields inherited from class slogo.language.GrammarElement
gelementsToValue
 
Constructor Summary
Towards(GrammarElement x, GrammarElement y)
           
 
Method Summary
 java.lang.Object evaluate(Context c)
          Evaluate this language construct in some context.
 
Methods inherited from class slogo.instruction.Instruction
evaluateNumericExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myX

GrammarElement myX

myY

GrammarElement myY
Constructor Detail

Towards

public Towards(GrammarElement x,
               GrammarElement y)
Method Detail

evaluate

public java.lang.Object evaluate(Context c)
Description copied from class: GrammarElement
Evaluate this language construct in some context. The evaluation may have side-effects, e.g., moving a turtle.

Overrides:
evaluate in class Instruction
Parameters:
c - context in which the evaluation takes place
Returns:
the result of evaluating the construct