package net.halbear.Terrain4J.EngineCore.Vulkan.Rendering.Pipeline;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;

public class IndexedLinkedHashMap<K,V> extends LinkedHashMap<K,V> {
    private final List<K> IndexList = new ArrayList<>();

    public int GetIndexOf(K key){
        return IndexList.indexOf(key);
    }

    public V GetValueAtIndex(int i){
        return super.get(IndexList.get(i));
    }

    @Override
    public V put(K key, V value){
        if(!super.containsKey(key)) IndexList.add(key);
        return super.put(key,value);
    }
}
