package edu.wisc.cs.games10.chrononaut;

public abstract class SimpleMovable implements IMovable {
	
	public SimpleMovable() {
		loc = new Vector2D(0, 0);
		vel = new Vector2D(0, 0);
		acc = new Vector2D(0, 0);
		tileHeight = 0;
		tileWidth = 0;
	}
	
	public boolean doesCollideWith(IMovable other) {
		Vector2D oLoc = other.getLocation();
		float oHeight = other.getTileHeight();
		float oWidth = other.getTileWidth();
		
		return (loc.x + this.getTileWidth() > oLoc.x && loc.x < oLoc.x + oWidth) && (loc.y + this.getTileHeight() > oLoc.y && loc.y < oLoc.y + oHeight);
	}

	public Vector2D getAcceleration() {
		return acc;
	}
	
	public Vector2D getVelocity() {
		return vel;
	}

	public Vector2D getLocation() {
		return loc;
	}

	public float getTileHeight(){
		return tileHeight;
	}
	public float getTileWidth(){
		return tileWidth;
	}
	
	public float getTerminalVelocity() {
		return .02f;
	}
	
	protected Vector2D loc;
	protected Vector2D vel;
	protected Vector2D acc;
	protected float tileHeight;
	protected float tileWidth;
}
