// 
// Decompiled by Procyon v0.6.0
// 

package com.hypixel.hytale.server.npc.navigation;

import it.unimi.dsi.fastutil.ints.Int2ObjectFunction;
import com.hypixel.hytale.server.npc.NPCPlugin;
import com.hypixel.hytale.component.ResourceType;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import javax.annotation.Nonnull;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import com.hypixel.hytale.component.Resource;

public class AStarNodePoolProviderSimple implements AStarNodePoolProvider, Resource<EntityStore>
{
    @Nonnull
    protected Int2ObjectMap<AStarNodePoolSimple> nodePools;
    
    public AStarNodePoolProviderSimple() {
        this.nodePools = new Int2ObjectOpenHashMap<AStarNodePoolSimple>();
    }
    
    public static ResourceType<EntityStore, AStarNodePoolProviderSimple> getResourceType() {
        return NPCPlugin.get().getAStarNodePoolProviderSimpleResourceType();
    }
    
    @Nonnull
    @Override
    public AStarNodePool getPool(final int childNodeCount) {
        return this.nodePools.computeIfAbsent(childNodeCount, AStarNodePoolSimple::new);
    }
    
    @Nonnull
    @Override
    public Resource<EntityStore> clone() {
        return new AStarNodePoolProviderSimple();
    }
}
