slogo.model
Class Turtle

java.lang.Object
  extended by slogo.model.Turtle

public class Turtle
extends java.lang.Object

This is the Turtle model class. It contains all information pertaining to the turtle's state, including location (x,y), pen position (up/down), direction (0-360), etc.

Author:
gehmane

Field Summary
private  int direction
           
private  java.awt.Point location
           
private  boolean penIsDown
           
 
Constructor Summary
Turtle()
           
Turtle(int x, int y, int startDir, boolean penDown)
           
Turtle(java.awt.Point p, int startDir, boolean penDown)
           
 
Method Summary
 java.awt.Point getLocation()
           
 double getX()
           
 double getY()
           
 int heading()
           
 void move(int distance)
           
 boolean penIsDown()
           
 void rotate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

location

private java.awt.Point location

direction

private int direction

penIsDown

private boolean penIsDown
Constructor Detail

Turtle

public Turtle()

Turtle

public Turtle(int x,
              int y,
              int startDir,
              boolean penDown)

Turtle

public Turtle(java.awt.Point p,
              int startDir,
              boolean penDown)
Method Detail

getLocation

public java.awt.Point getLocation()

getX

public double getX()

getY

public double getY()

heading

public int heading()

penIsDown

public boolean penIsDown()

move

public void move(int distance)

rotate

public void rotate()