#include "client/render/gui/ServerGui.h"

#include "client/render/gui/imgui/imgui.h"

namespace td {
namespace gui {

ServerGui::ServerGui(client::Client* client, server::Server* server) : GuiWidget(client), m_Server(server) {}


void ServerGui::Render() {
	ImGui::Begin("Integrated Server");
	ImGui::Text("Server TPS : %.1f", m_Server->GetTPS());
	ImGui::Text("Server MSPT : %i", (int)m_Server->GetMSPT());
	ImGui::Separator();
	if (ImGui::Button("Restart")) {
		m_Server->Restart();
	}
	ImGui::SameLine();
	if (ImGui::Button("Stop")) {
		m_Server->Stop();
	}
	ImGui::End();
}

} // namespace gui
} // namespace td
