#pragma once

#include <Common/Common.hpp>
#include <ImGui/imgui.h>

#include <CS2/SDK/Math/Rect_t.hpp>

class CCSPlayerController;
class C_CSPlayerPawn;
class CGlowProperty;

class IVisual
{
public:
	virtual void OnRender() = 0;
	virtual void OnClientOutput() = 0;
	virtual void OnCreateMove() = 0;
	virtual void OnDrawGlow( CGlowProperty* pCGlowProperty ) = 0;
};

class CVisual final : public IVisual
{
public:
	virtual void OnRender() override;
	virtual void OnClientOutput() override;
	virtual void OnCreateMove() override;
	virtual void OnDrawGlow( CGlowProperty* pCGlowProperty ) override;

private:
	enum EVisualBoxType_t : int32_t
	{
		BOX ,
		OUTLINE_BOX ,
		COAL_BOX ,
		OUTLINE_COAL_BOX ,
		CIRCLE_3D ,
		GLASSY_BOX ,
	};

	auto OnRenderPlayerEsp( CCSPlayerController* pCCSPlayerController , const Rect_t& bBox , const bool bVisible ) -> void;
	auto DrawBoneESP( C_CSPlayerPawn* pC_CSPlayerPawn , const bool bVisible , const int iTeamNum ) -> void;
	auto OnRenderPlayerText( CCSPlayerController* pCCSPlayerController , C_CSPlayerPawn* pPawn , const ImVec2& BoxMin , const ImVec2& BoxMax , const ImColor& PlayerColor , const bool bVisible ) -> void;
	auto OnRenderHealthBars( C_CSPlayerPawn* pPawn , const ImVec2& BoxMin , const ImVec2& BoxMax ) -> void;
	auto GetPlayerWeaponName( C_CSPlayerPawn* pPawn ) -> const char*;
	auto HasBomb( C_CSPlayerPawn* pPawn ) -> bool;

public:
	auto CalculateBoundingBoxes() -> void;
};

auto GetVisual() -> CVisual*;
