package mapped;

import java.util.Iterator;
import java.util.NoSuchElementException;
import net.runelite.mapping.Export;
import net.runelite.mapping.ObfuscatedSignature;
import net.runelite.rs.api.RSRuneLiteIterableNodeDeque;

public class RuneLiteIterableNodeDeque implements Iterator, RSRuneLiteIterableNodeDeque {
   @Export("node")
   @ObfuscatedSignature(
      descriptor = "Lsh;"
   )
   public Node node;
   @Export("nodeDeque")
   @ObfuscatedSignature(
      descriptor = "Lon;"
   )
   public final NodeDeque nodeDeque;

   @ObfuscatedSignature(
      descriptor = "(Lon;)V"
   )
   public RuneLiteIterableNodeDeque(NodeDeque var1) {
      this.nodeDeque = var1;
      this.node = this.nodeDeque.sentinel.previous;
   }

   @Export("next")
   @ObfuscatedSignature(
      descriptor = "()Lsh;"
   )
   public Node next() {
      if(this.nodeDeque.sentinel == this.node) {
         throw new NoSuchElementException();
      } else {
         Node var1 = this.node;
         this.node = this.node.previous;
         return var1;
      }
   }

   @Export("hasNext")
   public boolean hasNext() {
      return this.nodeDeque.sentinel != this.node;
   }

   @Export("remove")
   public void remove() {
      Node var1 = this.node.next;
      if(var1 == this.nodeDeque.sentinel) {
         throw new IllegalStateException();
      } else {
         var1.remove_base();
      }
   }
}
