package projectzombie.entity;

import bdf.types.BdfObject;
import gl_engine.vec.Vec3d;
import projectzombie.Main;
import projectzombie.model.IModel;
import projectzombie.world.chunk.Chunk;
import projectzombie.world.layer.Layer;

public abstract class EntityParticle extends Entity
{
	public abstract int getParticleCount();
	public abstract EntityParticlePart getParticleAt(int id);
	
	protected EntityParticle() {
	}
	
	public EntityParticle(Vec3d pos, Vec3d velocity) {
		super(pos, velocity);
	}
	
	@Override
	public void tick(Chunk chunk, Layer layer) {
		super.tick(chunk, layer);
		
		// Kill the particle if the player can't see it to reduce lag
		if(shouldKillParticle()) this.kill();
	}
	
	public boolean shouldKillParticle() {
		return Main.player.getPos().squareDistance(getPos()) > Chunk.RENDER_DISTANCE * 16;
	}
	
	@Override
	public IModel getModel() {
		return null;
	}
}
