/*
 * Created on 06.10.2004
 */
package gameObjects;

/**
 * @author Soccer Group I
 */
public abstract class GameObject {
	private double absX, absY;
	private float dist;
	private float dir;
	private float distChange;
	private float dirChange;
	private boolean seen;
	private int lastSeenTime=-1;
	
	// komplett sichtbares Objekt
	public GameObject(float dist, float dir, float distChange, float dirChange, int time){
		this.dist = dist;
		this.dir = dir;
		this.distChange = distChange;
		this.dirChange = dirChange;
		this.seen = true;
		this.lastSeenTime = time;
	}
	
	// nicht komplett sichtbares Objekt
	public GameObject(float dist, float dir, int time){
		this.dist = dist;
		this.dir = dir;
		this.seen = false;
		this.lastSeenTime = time;
	}
	
	public GameObject(int time) {
		this.lastSeenTime = time;
	}
	

	public double getAbsX() {
		return absX;
	}

	


	public double getAbsY() {
		return absY;
	}
	


	public float getDir() {
		return dir;
	}


	public float getDirChange() throws ObjectInvisibleException{
		if (!seen) throw new ObjectInvisibleException("directionChange ist nicht sichtbar");
		return dirChange;
	}


	public float getDist() {
		return dist;
	}


	public float getDistChange() throws ObjectInvisibleException{
		if (!seen) throw new ObjectInvisibleException("distanceChange ist nicht sichtbar");
		return distChange;
	}



	public boolean isSeen() {
		return seen;
	}

	/**
	 * @param i
	 */
	protected void setAbsX(double i) {
		absX = i;
	}

	/**
	 * @param i
	 */
	protected void setAbsY(double i) {
		absY = i;
	}

	/**
	 * @param f
	 */
	protected void setDir(float f) {
		dir = f;
	}

	/**
	 * @param f
	 */
	protected void setDirChange(float f) {
		dirChange = f;
	}

	/**
	 * @param f
	 */
	protected void setDist(float f) {
		dist = f;
	}

	/**
	 * @param f
	 */
	protected void setDistChange(float f) {
		distChange = f;
	}

	/**
	 * @param b
	 */
	protected void setSeen(boolean b) {
		seen = b;
	}

	protected void setLastSeenTime(int time){
		lastSeenTime = time;
	}
	
	public int getLastSeenTime(){
		return lastSeenTime;
	}
}
