AStarNodePoolSimple class
Пакет: com.hypixel.hytale.server.npc.navigation
Файл: com/hypixel/hytale/server/npc/navigation/AStarNodePoolSimple.java
implements: AStarNodePool
Поля (1)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
List<AStarNode> |
nodePool |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.npc.navigation;
class="kw">import it.unimi.dsi.fastutil.objects.ObjectArrayList;
class="kw">import java.util.List;
class="kw">public class AStarNodePoolSimple class="kw">implements AStarNodePool {
class="kw">protected class="kw">final List<AStarNode> nodePool = new ObjectArrayList();
class="kw">private class="kw">final int childCount;
class="kw">public AStarNodePoolSimple(int var1) {
this.childCount = var1;
}
@Override
class="kw">public AStarNode allocate() {
class="kw">return this.nodePool.isEmpty() ? new AStarNode(this.childCount) : this.nodePool.removeLast();
}
@Override
class="kw">public void deallocate(AStarNode var1) {
this.nodePool.add(var1);
}
}