package fr.altarik.toolbox.core.client.gui;

import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.Widget;
import net.minecraft.client.gui.widget.WrapperWidget;

import java.util.function.Consumer;

public abstract class MultiTabWrapperWidget<A extends Enum<A>, B extends Widget> extends WrapperWidget {

    protected final Screen parent;
    protected A currentTab;

    public MultiTabWrapperWidget(Screen parent) {
        this(parent, 0, 0, 0, 0);
    }

    public MultiTabWrapperWidget(Screen parent, int x, int y, int width, int height) {
        super(x, y, width, height);
        this.parent = parent;
    }

    protected void setCurrentTab(A currentTab) {
        this.currentTab = currentTab;
        update();
    }

    protected abstract B getCurrentTab();

    public abstract void update();

    public abstract void remove();

    @Override
    public void forEachElement(Consumer<Widget> consumer) {
        // ignore
    }

}
