package com.yourname.premiumah.gui;

import com.yourname.premiumah.model.SortMode;
import org.bukkit.Material;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public final class GuiHolder implements InventoryHolder {
    private final GuiType type;
    private final UUID viewer;
    private final int page;
    private final String context;
    private final SortMode sortMode;
    private final Material filter;
    private final Map<Integer, String> listingSlots = new HashMap<>();
    private final Map<Integer, String> claimSlots = new HashMap<>();
    private Inventory inventory;

    public GuiHolder(GuiType type, UUID viewer, int page, String context, SortMode sortMode, Material filter) {
        this.type = type;
        this.viewer = viewer;
        this.page = page;
        this.context = context;
        this.sortMode = sortMode;
        this.filter = filter;
    }

    public GuiType type() {
        return type;
    }

    public UUID viewer() {
        return viewer;
    }

    public int page() {
        return page;
    }

    public String context() {
        return context;
    }

    public SortMode sortMode() {
        return sortMode;
    }

    public Material filter() {
        return filter;
    }

    public Map<Integer, String> listingSlots() {
        return listingSlots;
    }

    public Map<Integer, String> claimSlots() {
        return claimSlots;
    }

    public void inventory(Inventory inventory) {
        this.inventory = inventory;
    }

    @Override
    public Inventory getInventory() {
        return inventory;
    }
}
