package projectzombie.display.bossbar;

import java.util.ArrayList;

public class BossBars
{
	private static final ArrayList<IBossBar> bossbars = new ArrayList<IBossBar>();
	
	public static void register(IBossBar bossbar) {
		bossbars.add(bossbar);
	}
	
	public static void clear() {
		bossbars.clear();
	}
	
	public static void render()
	{
		/*TextureReference health_fg = Models.UI_HEALTH_FG;
		TextureReference health_bg = Models.UI_HEALTH_BG;
		ArrayList<IBossBar> toRemove = new ArrayList<IBossBar>();
		
		double s = GlHelpers.getScale() / 10.0;
		
		// Render the boss bars
		int i = 0;
		for(IBossBar bossbar : bossbars)
		{
			double max_health = bossbar.maxHealth();
			double a = 1 - (bossbar.getHealth() / max_health);
			GlHelpers.begin();
			
			health_bg.texCoord(0, 1);	GlHelpers.vertex2(-4*s, 8.5*s - i);
			health_bg.texCoord(0, 0);	GlHelpers.vertex2(-4*s, 9.0*s - i);
			health_bg.texCoord(1, 0);	GlHelpers.vertex2(4*s, 9.0*s - i);
			health_bg.texCoord(1, 1);	GlHelpers.vertex2(4*s, 8.5*s - i);
			
			health_fg.texCoord(0, 1);	GlHelpers.vertex2(-4*s, 8.5*s - i);
			health_fg.texCoord(0, 0);	GlHelpers.vertex2(-4*s, 9.0*s - i);
			health_fg.texCoord(1-a, 0);	GlHelpers.vertex2(4*s-a*8*s, 9.0*s - i);
			health_fg.texCoord(1-a, 1);	GlHelpers.vertex2(4*s-a*8*s, 8.5*s - i);
			
			GlHelpers.end();
			i += 1;
			
			if(!bossbar.displayBossBar()) {
				toRemove.add(bossbar);
			}
		}
		
		for(IBossBar bossbar : toRemove) {
			bossbars.remove(bossbar);
		}*/
	}
}
