package v6.apps.zelvak;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;

public final class RunningContext {

	//private boolean paint;
	
	private int step;
	
	private int maxStep;
	
	private double pen = 0;
	
	private double angle = -Math.PI/2;
	
	private final BufferedImage image = new BufferedImage(700, 700, BufferedImage.TYPE_3BYTE_BGR);
	
	private final Graphics graphics = getImage().getGraphics();
	
	private Point position = new Point(350, 350);
	
	{
		graphics.setColor(Color.WHITE);
		graphics.fillRect(0, 0, image.getWidth(), image.getHeight());
		graphics.setColor(Color.BLACK);
	}
	
	public void doStep() throws InterruptedException{
		step++;
		if(maxStep == 0){
			return;
		}
		if(step>maxStep){
			throw new InterruptedException();
		}
	}
	
	public int getMaxStep() {
		return maxStep;
	}
	
	public void setMaxStep(int maxStep) {
		this.maxStep = maxStep;
	}
	
	public Graphics getGraphics() {
		return graphics;
	}
	
	public BufferedImage getImage() {
		return image;
	}
	
	public Point getPosition() {
		return position;
	}
	
	public void setPosition(Point position) {
		this.position = position;
	}
	
	public double getAngle() {
		return angle;
	}
	
	public void setAngle(double angle) {
		this.angle = angle;
	}
	
	/*public boolean getPaint() {
		return paint;
	}
	
	public void setPaint(boolean paint) {
		this.paint = paint;
	}*/
	
	public double getPen() {
		return pen;
	}
	
	public void setPen(double pen) {
		this.pen = pen;
	}
	
}
