
public class Player {
	private String name;
	private String position;
	private int x;
	private int y;
	public Player(String n, String p) {
		name = n;
		position = p;
	}
	
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the position
	 */
	public String getPosition() {
		return position;
	}

	/**
	 * @param position the position to set
	 */
	public void setPosition(String position) {
		this.position = position;
	}

	/**
	 * @return the x
	 */
	public int getX() {
		return x;
	}

	/**
	 * @param x the x to set
	 */
	public void setX(int x) {
		this.x = x;
	}

	/**
	 * @return the y
	 */
	public int getY() {
		return y;
	}

	/**
	 * @param y the y to set
	 */
	public void setY(int y) {
		this.y = y;
	}
	public void showPlayer() {
		System.out.println(name +" plays " +position +" at (" +x +"," +y +")");
	}
	public void move(int xDiff, int yDiff) {
		x = x + xDiff;
		y = y + yDiff;
	}
	public void kick(Ball b) {
		System.out.println(name +" kicks");
		if (this.getX() == b.getX() &&
				this.getY() == b.getY()) {
			b.setX(b.getX()+10);
			b.setY(b.getY()+10);
		}
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}

