package de.siphalor.was.visual.canvas.render;

import de.siphalor.was.util.Util;

import java.awt.*;

public abstract class TextureObject implements Renderable, Cloneable {
	private int x;
	private int y;
	private int width;
	private int height;

	protected TextureObject(int x, int y, int width, int height) {
		this.x = x;
		this.y = y;
		this.width = width;
		this.height = height;
	}

	public void mirrorX() {
		x += width;
		width = -width;
	}

	public void mirrorY() {
		y += height;
		height = -height;
	}

	public abstract Image getTexture();

	@Override
	public void tick(int delta) {

	}

	@Override
	public void render(Graphics graphics, int width, int height) {
		graphics.drawImage(getTexture(), x * width / 1600, y * height / 900, this.width * width / 1600, this.height * height / 900, Util.dummyImageObserver());
	}
}
