#pragma once
#include "Mod.h"

class BlockESP : public Mod {
public:
	bool coal = false;
	bool iron = false;
	bool gold = false;
	bool diamond = false;
	bool lapis = false;
	bool redstone = false;
	bool emerald = false;

	bool fill = true;
	bool nocovered = false;
	float range = 4.f;

	BlockESP() : Mod(_("Block ESP"), _("Render the ores."), Category::RENDER) {
		settings.push_back(new Setting{ _("Coal Ore"), &coal, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Iron Ore"), &iron, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Gold Ore"), &gold, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Diamond Ore"), &diamond, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Lapis Ore"), &lapis, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Redstone Ore"), &redstone, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Emerald Ore"), &emerald, 0, 0, 0, {}, true });

		settings.push_back(new Setting{ _("Visual Settings"), 0, 0, 0, 3, {}, true });
		settings.push_back(new Setting{ _("Fill"), &fill, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("No Covered"), &nocovered, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Range"), &range, new float(10.f), new float(0.f), 2, {}, true});

		enabled = false;
	}

private:
	struct RenderData {
		glm::vec3 lower;
		glm::vec3 upper;

		int blocktype;
	};
	std::vector<RenderData> renderdatas;
	virtual auto onWorldTick(Player* _this) -> void override;
	virtual auto onImGuiRender() -> void override;
};
