f73687b6d6
Changes to the implementation, is still not workin
23 lines
451 B
Java
23 lines
451 B
Java
import ch.aplu.turtle.Turtle;
|
|
|
|
/**
|
|
* Created by Christian on 10.02.2015.
|
|
*/
|
|
public class TurtleState {
|
|
private double x;
|
|
private double y;
|
|
private double heading;
|
|
|
|
public TurtleState(Turtle turtle) {
|
|
x = turtle.getX();
|
|
y = turtle.getY();
|
|
heading = turtle.heading();
|
|
}
|
|
|
|
public void returnToState(Turtle turtle) {
|
|
turtle.setX(x);
|
|
turtle.setY(y);
|
|
turtle.heading(heading);
|
|
}
|
|
}
|