package gui.menu;

import imgui.ImGui;

public abstract class BaseView {

	protected final StateMachine stateMachine;

	public BaseView(StateMachine stateMachine) {
		this.stateMachine = stateMachine;
	}

	public abstract void render();

	public void cleanResources() {}

	public void closeMenu(int count) {
		for (int i = 0; i < count; i++) {
			this.stateMachine.popState();
		}
	}

	public void closeMenu() {
		closeMenu(1);
	}

	protected void renderReturnButton() {
		if (ImGui.button("Retour")) {
			closeMenu();
		}
	}

}
