package interfaces;

import java.awt.Graphics2D;

import player.Player;
import utils.Point2f;

/*  ------------- Nihilne ------------
    * Created by Mitch Weaver - 2016 *
      ~~~~ All Rights Reserved ~~~~ */

public abstract class Entity implements GameObject {

	protected int width, height;
	protected Point2f pos;
	public Point2f center;
	public float radius;
	public boolean alive = true, playerCollided, discovered;
	public int health;
	
	public abstract void tick();
	
	public abstract void render(Graphics2D g2d);

	protected double dist = 0;
	protected float sum = 0;
	protected Point2f center2 = new Point2f(0, 0); // to stop mass method calls

	public boolean getDiscoveryStatus() {
		if(!discovered) return discovered = Player.DISCOVERY.contains(center.x, center.y);
		else return discovered;
	}
	
	public boolean checkIfAlive() { 
		return alive = health > 0;
	}
	
}
