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

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

import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import java.util.List;

public class AStarNodePoolSimple implements AStarNodePool
{
    protected final List<AStarNode> nodePool;
    private final int childCount;
    
    public AStarNodePoolSimple(final int childCount) {
        this.nodePool = new ObjectArrayList<AStarNode>();
        this.childCount = childCount;
    }
    
    @Override
    public AStarNode allocate() {
        return this.nodePool.isEmpty() ? new AStarNode(this.childCount) : this.nodePool.removeLast();
    }
    
    @Override
    public void deallocate(final AStarNode node) {
        this.nodePool.add(node);
    }
}
