import java.awt.Color;

public class Bug
{
	// *************** constructors  **************************
		
	// constructs a red bug that is facing north
	public Bug()
	{
		myColor = Color.RED;
		myDirection = Location.NORTH;
		myLocation = null;
	}

	public Bug(Color bugColor)
	{
		setColor(bugColor);
	}

	// *************** accessor methods ***********************	
	
	public int getDirection()
	{
		return myDirection;
	}
	
	public int getLocation()
	{
		return myLocation;
	}
	
	// *************** modifier methods ***********************	
	public void setDirection(int newDirection)
	{
		myDirection = newDirection % 360;
	}
	public void setColor(Color newColor)
	{
		myColor = newColor;
	}

	public void moveTo(Location newLocation)
	{
		myLocation = newLocation;
	}

	// *************** "interesting" methods ***********************
	
	// reverses the direction of the bug	
   	public void act()
	{
		setDirection(getDirection() + 180);					
	}

	// turns bug 45 degrees to right w/o changing its location
	public void turn()
	{
		setDirection(getDirection() + 45);	
	}

	// *************** properties ************************
	private Location myLocation;
	private int myDirection;
	private Color myColor;
}