HyCodeYourTale
classpublicPriority 3

FloodFillEntryPoolSimple

com.hypixel.hytale.server.spawning.util.FloodFillEntryPoolSimple

2

Methods

2

Public Methods

0

Fields

1

Constructors

Constants

intENTRY_SIZE= 5

Constructors

public
FloodFillEntryPoolSimple()

Methods

Public Methods (2)

public
int[] allocate()
public
void deallocate(int[] entry)

Source Code

package com.hypixel.hytale.server.spawning.util;

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

public class FloodFillEntryPoolSimple {
   private static final int ENTRY_SIZE = 5;
   private final List<int[]> entryPool = new ObjectArrayList();

   public FloodFillEntryPoolSimple() {
   }

   public int[] allocate() {
      return this.entryPool.isEmpty() ? new int[5] : this.entryPool.removeLast();
   }

   public void deallocate(int[] entry) {
      this.entryPool.add(entry);
   }
}