package scenery;

import java.awt.image.ImageObserver;

import gUI.Camera;
import bounds.Bounds;
import coords.Coords;
import gUI.PirateNinjaBoxerPanel;
import unit.ID;

public class Scenery extends ID {

    public Bounds bounda = null;
    public Coords placement;
    public double width = 20.0;
    public double height = 20.0;
//	public gUI.PirateNinjaBoxerPanel pP;
    //protected MoveTimer _timer;

    public Scenery(String type, Coords placementa) {
        super("Scenery", "Non-moving", type);
        this.placement = placementa;
//		pP = aP;
        bounda = new Bounds(this);
    }

    public void paintComponent(java.awt.Graphics2D bB, PirateNinjaBoxerPanel iO, Camera viewer) {
        
        int drawX = 10;
        int drawY = 0;

        if (iO.axesShow.getX() > 0) {
            drawX = (int) this.placement.flattenGlobal().getX();
            drawY = (int) this.placement.flattenGlobal().getY();
        } else if (iO.axesShow.getX() < 0) {
            drawX = (int) (iO.farRight - this.placement.flattenGlobal().getX());
            drawY = (int) this.placement.flattenGlobal().getY();
        } else {
            //TODO: Cover -Z 
            drawX = (int) this.placement.flattenGlobal().getZ();
            drawY = (int) this.placement.flattenGlobal().getY();
        }


        if (iDP == "Ellipse") {
            bB.drawOval((int) (this.placement.getX() - viewer.getX()), (int) (this.placement.getY() - viewer.getY()), (int) this.width, (int) this.height);
            bB.fillOval((int) (this.placement.getX() - viewer.getX()), (int) (this.placement.getY() - viewer.getY()), (int) this.width, (int) this.height);
            //bounda.rect.setRect((placement.getX() - viewer.getX()), (placement.getY() - viewer.getY()), bounda.rect.getWidth(), bounda.rect.getHeight());
        } else if (iDP == "Square") {
            bB.drawRect((int) (this.placement.getX() - viewer.getX()), (int) (this.placement.getY() - viewer.getY()), (int) this.width, (int) this.height);
            bB.fillRect((int) (this.placement.getX() - viewer.getX()), (int) (this.placement.getY() - viewer.getY()), (int) this.width, (int) this.height);
            //bounda.rect.setRect((placement.getX() - viewer.getX()), (placement.getY() - viewer.getY()), bounda.rect.getWidth(), bounda.rect.getHeight());
        } else {
            bB.drawRect((int) (this.placement.getX() - viewer.getX()), (int) (this.placement.getY() - viewer.getY()), (int) this.width, (int) this.height);
            bB.fillOval((int) (this.placement.getX() - viewer.getX()), (int) (this.placement.getY() - viewer.getY()), (int) this.width, (int) this.height);
            //bounda.rect.setRect((placement.getX() - viewer.getX()), (placement.getY() - viewer.getY()), bounda.rect.getWidth(), bounda.rect.getHeight());
        }

    }
}
