package gUI;

import coords.Coords;
import bounds.Bounds;
import unit.ID;

public class Camera extends ID {
	public Coords viewTop;
	public gUI.PirateNinjaBoxerPanel aP;
	//public Bounds bounda;
	
	public Camera(Coords placement, gUI.PirateNinjaBoxerPanel pP)
	{
		super("Camera", "Camera", "Camera");
		viewTop = new Coords(placement);
		aP = pP;
//		bounda = new Bounds(this.viewTop, pP);
	}
	public double getX()
	{
		return viewTop.getX();
	}
	public double getY()
	{
		return viewTop.getY();
	}
	public double getFarX()
	{
		return (viewTop.getX() + aP.WIDTH);
	}
	public double getFarY()
	{
		return (viewTop.getY() + aP.HEIGHT);
	}
	public void moveLeft()
	{
		if(this.getX() < 1)
		{
			
			return;
		}
		viewTop.addToPart(-1.0, "x");
//		bounda.rect.setLocation((int)viewTop.getX(), (int)viewTop.getY());
	}
	public void moveRight()
	{
		if(getFarX() >= aP.farRight)
		{
			return;
		}
		viewTop.addToPart(1.0, "x");
//		bounda.rect.setLocation((int)viewTop.getX(), (int)viewTop.getY());
	}
	public void moveDown()
	{
		if(this.getFarY() >= aP.farDown)
		{
			return;
		}
		viewTop.addToPart(1.0, "y");
//		bounda.rect.setLocation((int)viewTop.getX(), (int)viewTop.getY());
	}
	public void moveUp()
	{
		if(this.getY() < 1)
		{
			return;
		}
		viewTop.addToPart(-1.0, "y");
//		bounda.rect.setLocation((int)viewTop.getX(), (int)viewTop.getY());
	}
	
	
	
}
