package mapped;

import java.util.Iterator;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
import net.runelite.rs.api.RSIterableDualNodeQueueIterator;

@ObfuscatedName("ph")
public class IterableDualNodeQueueIterator implements Iterator, RSIterableDualNodeQueueIterator {
   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "Lpo;"
   )
   IterableDualNodeQueue queue;
   @ObfuscatedName("ah")
   @ObfuscatedSignature(
      descriptor = "Lsn;"
   )
   DualNode head;
   @ObfuscatedName("ar")
   @ObfuscatedSignature(
      descriptor = "Lsn;"
   )
   DualNode last;

   @ObfuscatedSignature(
      descriptor = "(Lpo;)V"
   )
   IterableDualNodeQueueIterator(IterableDualNodeQueue var1) {
      this.last = null;
      this.queue = var1;
      this.head = this.queue.sentinel.previousDual;
      this.last = null;
   }

   public boolean hasNext() {
      return this.queue.sentinel != this.head;
   }

   public Object next() {
      DualNode var1 = this.head;
      if(var1 == this.queue.sentinel) {
         var1 = null;
         this.head = null;
      } else {
         this.head = var1.previousDual;
      }

      this.last = var1;
      return var1;
   }

   public void remove() {
      this.last.removeDual_base();
      this.last = null;
   }
}
