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.RSRuneLiteIterableLinkDeque;

public class RuneLiteIterableLinkDeque implements Iterator, RSRuneLiteIterableLinkDeque {
   @Export("link")
   @ObfuscatedSignature(
      descriptor = "Lse;"
   )
   public Link link;
   @Export("linkDeque")
   @ObfuscatedSignature(
      descriptor = "Lpu;"
   )
   public final LinkDeque linkDeque;

   @ObfuscatedSignature(
      descriptor = "(Lpu;)V"
   )
   public RuneLiteIterableLinkDeque(LinkDeque var1) {
      this.linkDeque = var1;
      this.link = this.linkDeque.sentinel.previous;
   }

   @Export("next")
   @ObfuscatedSignature(
      descriptor = "()Lrm;"
   )
   public FriendLoginUpdate next() {
      if(this.linkDeque.sentinel == this.link) {
         throw new NoSuchElementException();
      } else {
         FriendLoginUpdate var1 = (FriendLoginUpdate)this.link;
         this.link = this.link.previous;
         return var1;
      }
   }

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

   @Export("remove")
   public void remove() {
      Link var1 = this.link.next;
      if(var1 == this.linkDeque.sentinel) {
         throw new IllegalStateException();
      } else {
         var1.remove_base();
      }
   }
}
