/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * models a simple insect living on a Cartesian grid
 * @author pikalek
 */
public class Insect {
	private String name;
	private int xPosition;
	private int yPosition;
	/**
	 * create a new insect at 0,0
	 * @param n		name to use for the insect
	 */
	public Insect(String n)
	{
		name = n;
		xPosition=0;
		yPosition=0;
	}
	/**
	 * create a new insect at the given coords
	 * @param n		name to use for the insect
	 * @param x		starting x position
	 * @param y		starting y position
	 */
	public Insect(String n, int x, int y)
	{
		name = n;
		xPosition = x;
		yPosition = y;
	}
	/**
	 * move the insect up one
	 */
	public void moveUp()
	{
		yPosition += 1;
	}
	/**
	 * move the insect down one
	 */
	public void moveDown()
	{
		yPosition -= 1;
	}
	/**
	 * move the insect left one
	 */
	public void moveLeft()
	{
		xPosition -= 1;
	}
	/**
	 * move the insect left one
	 */
	public void moveRight()
	{
		xPosition += 1;
	}
	/**
	 * get the name for the insect
	 * @return	name for the insect
	 */
	public String getName()
	{
		return name;
	}
	/**
	 * get the current y position
	 * @return	current y position
	 */
	public int getY()
	{
		return yPosition;
	}
	/**
	 * get the current x position
	 * @return	current x position
	 */
	public int getX()
	{
		return xPosition;
	}

}

